Skip to content
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

Linux: OOM when a kernel debug symbols is used as input #20

Closed
gcmoreira opened this issue Jul 28, 2020 · 3 comments
Closed

Linux: OOM when a kernel debug symbols is used as input #20

gcmoreira opened this issue Jul 28, 2020 · 3 comments

Comments

@gcmoreira
Copy link

Dwarf2json out of memory when parsing Linux kernel debug symbols.
The QEMU VM used for this have Ubuntu 18.04.4 amd64 stock kernels 4.18.0-25-generic and I also tried with 5.4.0-42-generic.
The command lines were:
./dwarf2json linux --elf /usr/lib/debug/boot/vmlinux-5.4.0-42-generic
or
./dwarf2json linux --elf /usr/lib/debug/boot/vmlinux-5.4.0-42-generic --system-map System.map-5.4.0-42-generic

The dmesg error was:

[  148.628383] Out of memory: Killed process 1322 (dwarf2json) total-vm:5022196kB, anon-rss:3736096kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:8012kB oom_score_adj:0

I tried from inside of the virtual machine first with 2GB of RAM which later increased to 4GB and 8GB but it didn't fix the problem.
Finally, I got dwarf2json working in a 16GB RAM host.
I'm aware Dwarf itself requires a lot of memory but I think it would be great to see if this limitation could be addressed in the future.

@ilch1
Copy link
Collaborator

ilch1 commented Jul 28, 2020

Thanks for reporting the issue. I haven't seen an OOM error before, but my machine has 16 GB of RAM.

I would need to run a profiler to determine what is using the memory. While some optimizations may be possible, the output format is such that the entire symbols structure resides in memory before being written out as JSON. My guess is that is taking up a large chunk of total memory by dwarf2json.

At the very least, we can update documentation with recommended RAM.

@NiklasBeierl
Copy link

Experiencing an OOM as well in a 4gig VM, had to run it on the host.

ilch1 added a commit that referenced this issue Feb 10, 2021
@ilch1
Copy link
Collaborator

ilch1 commented Feb 10, 2021

Documentation added in PR #29.

@ilch1 ilch1 closed this as completed Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants