Are you creating new sections of polygons and destroying them as the user
moves around? If you do, you may be creating and deleting objects too
quickly for the garbage collector to keep up. One way to address is to use
the -mx option (for example -mx32m) to increase the maximum amount of memory
used by the VM. The default is 16 Mb. Increasing the limit would probably
allow the GC to run and cleanup your polygons before it is too late.
You may want to consider reusing the polygons instead. For example, you
could create sections of polygons for the terrain and simply move the
sections from the back of the user to the front of the user as needed. If
you define indexed polygon sets with the ability to modify the vertex
coordinates, you can simply reposition all of the vertices when you move the
polygon section to make the new section of the terrain look different (you
may have to make other changes for textures as well).
Roberto Speranza
President, Dot Internet Solutions Inc.
mailto:[EMAIL PROTECTED]
http://www.dotinc.net/
----- Original Message -----
From: Tim Bray <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: September 24, 1999 10:24 AM
Subject: [JAVA3D] Yow... this sucker burns memory
> I'm modeling an (effectively) infinitely large surface by cleverly
> stitching things into the scene graph ahead of them and whipping them
> out behind as the user moves around. Works OK, except the memory
> usage seems to grow monotonically until after a couple minutes java
> barfs on out-of-memory. OK, I'm testing on an NT box with a (pathetically
> wimpy these days, I guess) 96M, but *this sucks*. In particular since
> I'm careful to handbuild my shapes for low polygon count and keep the
> number of textures way down and so on. Put simply, it means
> that the application cannot be used in the real world.
>
> OK... I take subgraphs out with removeChild. I do have a lot of shared
> Materials and suchlike nodeComponents, are the internal structures such
> that the removed subgraphs might not get GC'ed if these are still in
> play? Is there any body of experience on memory conservation in J3D?
> Is it ever a good idea to call System.gc()?
>
> Hmm... I do tend to place things by stacking up several transforms
> rather than combining them, are transforms brutally expensive in memory?
>
> -Tim
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff JAVA3D-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".