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

IDA pro shows out of memory when import 50MB exe by labeless #57

Open
anaivebird opened this issue Feb 7, 2021 · 3 comments
Open

IDA pro shows out of memory when import 50MB exe by labeless #57

anaivebird opened this issue Feb 7, 2021 · 3 comments

Comments

@anaivebird
Copy link

It seems that IDA's default database memory config is as following:
(copy from ida.cfg)
// Memory configuration parameters
// -------------------------------
// NOTES:
//
// 1. DATABASE_MEMORY determines how much memory will be allocated
// for names, strings, xrefs, functions, etc. If it is == 0 then
// IDA uses the following alrogithm:
//
// DATABASE_MEMORY = new_file
// ? input_file_size * 4
// : old_btree_size/2
// IDA never allocates more than 128MB in this case.
//
// 2. page sizes (VPAGESIZE and NPAGESIZE) must be powers of 2.
//
// 3. if VPAGES == 0 then 32bit IDA reserves memory by the following
// alrogithm:
//
// VMEM = new_file
// ? input_file_size4
// : allocated_addressing_space;
//
// VPAGES = VMEM / VPAGESIZE
//
// 4. Here is the total amount of memory allocated when IDA starts:
//
// TOTAL = DATABASE_MEMORY + VPAGESIZE
VPAGES + NPAGESIZE*NPAGES
//
DATABASE_MEMORY = 0 // Size of btree buffer in bytes.
VPAGESIZE = 8192 // Virtual memory page size
// (effective for new bases only)
// 8192 => 128MB addressing space is the limit
VPAGES = 0 // Size of virtual memory window
// (in pages)
NPAGESIZE = 8192 // Name pointers page size
// (effective for new bases only)
NPAGES = 32 // how big will be the memory buffer?
// (each name uses 4 bytes)
// The default settings allow to keep
// in memory 2^16 names. The remaining
// names will be swapped to the disk.

That is:
DATABASE_MEMORY = new_file ? input_file_size * 4 : old_btree_size/2
VMEM = new_file ? input_file_size*4 : allocated_addressing_space

Since labeless creates stub database which is very small, the database limit is very low, and prone to out of memory.

My solution is to manually change the limit to solve it.

But I wonder why IDA pro limit database_memory to 2GB and VMEM to 1GB, when I have 1TB NVMe SSD and 32GB RAM.

I put this issue just to notify anyone else meet this problem to know the solution. Thx.

@a1ext
Copy link
Owner

a1ext commented Feb 7, 2021

Hi @anaivebird, does the limit depends on presence of Labeless plug-in?

@anaivebird
Copy link
Author

Not directly, but DATABASE_MEMORY = input_file_size * 4 for new file by default, since labeless load a small stub database, I think it influence the limit.

@a1ext
Copy link
Owner

a1ext commented Feb 2, 2024

hi @anaivebird did you check, is there a programmatic way to increase this limit?

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

2 participants