-
Notifications
You must be signed in to change notification settings - Fork 406
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
Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS #604
Comments
I just realized this solution NixOS/hydra#549 that I did not try. I am trying it. |
Okay, I see you've found a workaround. But let's keep the issue open - the proper way, I think, is to remove MAX_HEAP_SECTS constant usage in bdwgc. |
Related issue (closed): #143 |
This workaround actually does not work once the memory required exceeds a certain threshold (e.g. 100GB). The proper workaround is to rewrite the program to reduce the number of allocations. |
The workaround also requires grouping allocations together to prevent fragmentation. For example, if the following allocation sequences are repeated: [ 8 bytes, 1 Kb, 8 bytes, 1 Kb, 1 Kb, 8 bytes, 1 Kb, 1 Kb ...] where only the 8 bytes allocation are retained and all 1Kb allocations are set for gc, then the collector will error out very easily. This problem is actually very severe, in my case, the program crashes with only a 8 GB heap. Will continue to investigate a workaround. |
Sorry if this is a dumb question. I have a program that repeatedly allocates medium sized blocks (around 2KB~2MB) consecutively for 3 minutes, and roughly all blocks are discarded seconds after allocation. The libgc runtime still prompts the error.
I manually increased those values in
gc_priv.h
. However, the issue still persists.I tried both master and ubuntu distribution libgc-8.0.6 with
apt source libgc-dev
on ubuntu-WSL2. Here're the relevant changes and information about the built shared object.Changes:
SO BSS information:
I have also tried incrementing
MAX_HEAP_SECTS
but notMAXHINCR
, and nothing works.I also tried to set the enviroment variable, which fails.
I greatly appreciate any suggestions on working around this issue.
The text was updated successfully, but these errors were encountered: