Skip to content

Importing consumes a lot of memory. #24

Description

@vext01

Hi,

I've been experimenting with CTADL's PCODE frontend.

I've been able to import small toy binaries and run queries, but anything larger and the import step causes my system to run out of memory.

For example, trying to import /bin/ls, a relatively small program:

$ ls -al /bin/ls
lrwxrwxrwx 1 root root 29 Sep 26  2025 /bin/ls -> ../lib/cargo/bin/coreutils/ls
$ du -hs $(realpath /bin/ls)
11M     /usr/lib/cargo/bin/coreutils/ls
$ ctadl import pcode /bin/ls -o work

I have btop running and can see Java consume GBs of memory, eventually exhausting the system and making it unresponsive (the system is a VM with about 5GB of RAM).

(Putting some heap limits in place, I can stop it killing the system and get a dump out of Java, but it doesn't look all that useful)

Would we expect this much memory consumption?

As I understand, the import step is just calling ghidra to get the PCODE as fact files (and not doing any actual datalog stuff)? Perhaps this can be tweaked to be more memory efficient?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions