-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory and CPU usage is very high. OOM exception killed Trivy #1295
Comments
@knqyf263 Is there any performance matrix for CPU and Memory consumption happening in Trivy to which we can refer to? I see CPU and Memory usage going high for filesystem projects. Please let us know your suggestion and guidelines. Thanks !! |
@knqyf263 / @santhosh1729 / @masahiro331 Anyone can help with this bug? Thanks ! |
Hi @hideme4u! thanks for your feedback! |
@afdesk Thanks a lot. Just to add some profiling data for CPU ... (pprof) top20 |
Hi @afdesk Any comment on the above issue |
hi @hideme4u! thanks a lot! your log is really useful |
@hideme4u it seems that your instance has a lot of large jar-files. |
@afdesk Okay, thanks for the update !. waiting to see the change/fix. |
@afdesk hello? Any update? |
We're working on it here. |
Description
I am using trivy 0.20.0 for filesystem scan on the entire filesystem.
trivy -v
Version: 0.20.0
Command executed: trivy fs /
Machin configuration: quad-core cpu.
Total filesystem size: 92 GB, Used: 89 GB
After this, I saw Trivy process is consuming Resident memory up to 3GB and CPU usage goes beyond 300% and finally process gets killed (OOM)
What did you expect to happen?
The scan should have been completed and Trivy process should have consumed Memory and CPU within acceptable limit.
What happened instead?
Process start consuming more and more Resident memory and CPU usage remains very high throughout above at least 200%. Maximum all core all consumed. and Finally process gets killed.
trivy fs --timeout 180m /
2021-10-14T16:20:53.384+0530 INFO Need to update DB
2021-10-14T16:20:53.385+0530 INFO Downloading DB...
24.29 MiB / 24.29 MiB [-------------------------------------------------------------------------------------------------------------] 100.00% 5.55 MiB p/s 5s
fatal error: runtime: out of memory
runtime stack:
runtime.throw({0x18cd716, 0xa000000})
/opt/hostedtoolcache/go/1.17.1/x64/src/runtime/panic.go:1198 +0x71
runtime.sysMap(0xc186c00000, 0x429680, 0xc000095e90)
/opt/hostedtoolcache/go/1.17.1/x64/src/runtime/mem_linux.go:169 +0x96
runtime.(*mheap).grow(0x297e3c0, 0x4ef7)
/opt/hostedtoolcache/go/1.17.1/x64/src/runtime/mheap.go:1393 +0x225
runtime.(*mheap).allocSpan(0x297e3c0, 0x4ef7, 0x0, 0x1)
/opt/hostedtoolcache/go/1.17.1/x64/src/runtime/mheap.go:1179 +0x165
runtime.(*mheap).alloc.func1()
/opt/hostedtoolcache/go/1.17.1/x64/src/runtime/mheap.go:913 +0x69
runtime.systemstack()
/opt/hostedtoolcache/go/1.17.1/x64/src/runtime/asm_amd64.s:383 +0x49
Output of
trivy -v
:trivy -v
Version: 0.20.0
Additional details (base image name, container registry info...):
The text was updated successfully, but these errors were encountered: