Memory Fragmentation

New Message Reply Date view Thread view Subject view Author view

Troy Stephen (troys++at++wormald.com.au)
Fri, 23 May 1997 18:56:19 +1111 (EST)


Hi All,

I have a suspected fragmentation problem with my shared memory arena.

My flight sim application has an asynchronous DBASE process which pages
database tiles as we traverse over the terrain. As it loads in each
database tile, it creates a new branch with all the required pfNodes and
attaches it to the scene graph with the pfMergeBuffer() call. When parts
of the scene graph are no longer required, they are detached and
pfAsyncDelete'ed.

After flying around for a few hours, the application crashes trying to
ammalloc some space, and a Performer message recommends that I increase
the size of my arena.

The length of time the application stays up seems to be inversely
proportional to the amount of paging that is occuring.

I am confident that we are using pfBuffer's correctly and that we are not
forgetting to delete things when we no longer need them.

I have been taking statistics of the arena by calling amallinfo
periodically during a flight. This is what happens:

(1) Space in "ordinary blocks in use" increases at first and then levels
out.
(2) Ditto for small blocks.
(3) The Total space in the arena gradually increases until it reaches
PFSHAREDSIZE before crashing.

The machine is an Onyx RE2 configured with 384meg memory.

Performer 2.1 is installed with the 2.0.2 compat libraries.

The shared arena is being created in swap space (approx 800meg).

The environment variable: PFSHAREDSIZE is set to 450000000

These are the tweaks I have done on the arena:

amallopt(M_MXCHK, 1000000, pfGetSharedArena());
(as suggested by Sharon Clay)

amallopt(M_FREEHD, 1, pfGetSharedArena());
amallopt(M_MXFAST, 64, pfGetSharedArena());
amallopt(M_GRAIN, 64, pfGetSharedArena());

the DBASE process is the only place pfNew*() calls are made inside the
real-time loop.

OK, if you're still reading, here are my questions:

Has anyone investigated similar problems with their applications and what
did you do?

How should I go about determining the values to use for all the amallopt
calls?

What values should I set for the process resources: "memoryuse" and
"vmemoryuse"?

There seems to be some limit to what I can set PFSHAREDSIZE to. If I try
to set it beyond that value, Performer creates an arena half the size I
asked for. What is happening here??

Any suggestions are welcome!!!

Thanks,
Troy Stephen

PS. I have looked into implementing a recycling facility for all the
pfNodes, but it appears to be quite difficult due to multiprocessing
considerations.

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:17 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.