This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Reducing memory consumption



  In message <200003212007.VAA04889@quatramaran.ens.fr>you write:
  > >Very simple.  We've created a partition in our memory space.  ie, there
  > >is the stuff that is managed by GC and the stuff that isn't.  There
  > >may be megabytes of contiguous memory held by GC waiting for reclaimation
  > >but an xmalloc call can still fail.
  > 
  > Call me stupid, but...
  > how hard is it to trigger a gc if malloc fails ?
Difficult.  Because of...


  > Or is there a kind of `critical section' issue with the gc, that states
  > that you can't call it everywhere you can call malloc ?
Yes.  Aside from one or two special cases, GC can only be triggered between
optimization passes, whereas malloc can be called anytime.

  > Or is the gc-reclaimed memory not really reclaimed for anything except gc, 
  > and in particular not usable for a malloc ?
Yes/no.  It can be reclaimed, but pages are not immediately reclaimed.  Instead
unused pages are held on for a little while and used to satisfy new
allocations.

We might be able to have a malloc failure trigger a release of all the pages
on the unused list.


jeff



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]