[Gc] Gc with DirectX

Boehm, Hans hans_boehm@hp.com
Fri, 31 Oct 2003 11:36:11 -0800


I think you're running into an occasionally reported problem with the
collector scanning the frame buffer under win32.

The collector looks for non-heap memory that is writable and treats it
as part of the root set.  In some cases, the frame buffer seems to fit
that description.

(There are aspects to this I don't understand.  In particular, I would
have expected the frame buffer should be mapped non-cacheable, in which case,
the collector should know to ignore it, at least if VirtualQuery
works as advertised.  I would also still like to really see the VirtualQuery
results for the frame buffer mapping to see whether it is somehow
distinguishable in another way.  Any insight would be greatly appreciated,
since I haven't reproduced the problem locally.)

To deal with this, I would:

1) Upgrade to 6.3alpha2, at least for testing.

2) See if the problem goes away if you set the GC_IGNORE_FB environment
variable.  This looks for something like large power-of-2 mappings.  I would
really like to be able to use a better test and turn this on by default.

3) If not, either call GC_dump() after the application and GC have started,
or run the application with the GC_DUMP_REGULARLY environment variable
defined.  Look at the root set and/or send me the output (or post the section
describing the roots).

You should also be able to explicitly register only necessary roots by
setting GC_no_dls, calling GC_clear_roots(), and then repeatedly
calling GC_add_roots().  But this can be tricky to get right.  (Stacks
will still be scanned implicitly.)

Hans

> -----Original Message-----
> From: gc-admin@napali.hpl.hp.com [mailto:gc-admin@napali.hpl.hp.com]On
> Behalf Of Nicolas Cannasse
> Sent: Friday, October 31, 2003 1:11 AM
> To: gc@napali.hpl.hp.com
> Subject: [Gc] Gc with DirectX
> 
> 
> Hello list,
> 
> I have a little problem when using the GC with DirectX. On my 
> Dell laptop
> running XP there is no problem, the memory used is around 10 
> Megabytes, but
> on some other computer running 2k the memory is growing up to 
> 60 Megabytes
> before stopping, and then it looks like the GC is taking a 
> lot of time and
> is sometimes even freezing the whole system in the gc_collect_little()
> calls. Have someone already experienced such problem ? Turning on
> incremental collection does the same result.
> 
> My project is made of several DLLs , one running a Virtual 
> Machine and some
> others providing the access to several resources. Maybe the problem is
> related to the DLLs heap's scanning. Can I have more details 
> on how the
> DLL's heaps are detected/scanned by the GC ? Should I try to 
> empty the roots
> and the add only the ones I'm actually using ? Maybe that DirectX is
> allocating virtual pages with writing access on 2k , and 
> these are scanned
> later by the GC ? How can I override this ?
> 
> Thanks a lot for this nice sofware,
> 
> Nicolas Cannasse
> 
> _______________________________________________
> Gc mailing list
> Gc@linux.hpl.hp.com
> http://linux.hpl.hp.com/cgi-bin/mailman/listinfo/gc
>