[Gc] Re: Re: Want to find reason of heap size keep growth

biosli biosli at hotmail.com
Fri Jul 9 03:57:22 PDT 2010


Ivan Maidanski <ivmai at ...> writes:

> > I checked GC_dump(), finding when heap size grows.
> > 
> > I got the following warnings:
> > 
> > GC Warning: Repeated allocation of very large block (appr. size 2305024):
> > 	May lead to memory leak and poor performance.
> > 	
> > Then the heap size grows.
> > 
> > I've used GC_MALLOC_ATOMIC_IGNORE_OFF_PAGE malloc large block (as bitmap 
array, 
> > data array, or string).
> 
> If possible, call GC_set_all_interior_pointers(0) before GC_INIT() and use 
GC_MALLOC[_ATOMIC].
> 
> This strategy solved my similar problem: 
http://article.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/2532

Thanks a lot. But I use multiple inheritance in my project.
If I set GC_all_interior_pointers to 0, it may lead my process crash.


> > Can you kindly advise how i can prevent this warning from happening?
> 
> Turning it off (in a release code) is easy:
> 
> #define GC_IGNORE_WARN
> #include "gc.h"
> 
> main() {
>  GC_INIT();
>  ...
> }
> 
> But, of course, you should be aware that it "May lead to poor performance" 
and to running out of memory.

Hehe, I got it.:)
> 
> > 
> > Thanks for all you help.
> 






More information about the Gc mailing list