Re: Help needed wrt apparent memory leak in IRIS Performer 2.2

New Message Reply Date view Thread view Subject view Author view

Yair Kurzion (yair++at++polygon.engr.sgi.com)
Fri, 20 Aug 1999 12:03:23 -0700 (PDT)


> I am having a problem with what appears to be a memory leak in IRIS
> Performer; namely it seems to not be properly freeing memory in the
> shared memory arena. As I have a large number of pfGeoSets which need
> to constantly change size (we are dynamically retesselating a terrain
> mesh and have to work with pre-existing pfGeoSets, due to the client's
> requirements), I am having to constantly pfMalloc the pfGeoSets'
> attribute lists, and make use of Performer's garbage collection (pfFlux
> apparently can't deal with allocations which change size).

You should note that GeoSet attributes are not multi-buffered. In other words,
all processes see the same GeoSet and the same attribute memory. Changing
an attribute list in the App is NOT MP-safe because DRAW may be using this '
memory.

This is the reason why Fluxed GeoSets came about. A Fluxed Geoset is a
Flux that contains a GeoSet structure. This structure is multi-buffered so
you can safely change its attribute pointers in the App and expect them to
arrive at the Draw in a frame accurate manner.

The source code in pguide/libpf/C++/fluxed_gset.C uses a Fluxed GeoSet.

> Another indication that the heap is having trouble is that before I used
> constant pfMalloc()s as a replacement for pfFlux, I set Performer up to
> only use a single processor (just for testing purposes, as we require
> multiprocessor support), and just used pfRealloc() on the attribute
> lists. After a comparable amount of time, the program would crash with
> the same error (namely that the arena was filled up).

Say you had N bytes of memory, and you now need (N+1), do you Realloc (N+1) or
something in the order of 2N ?

Can you count how many times you Realloc your attributes before crashing ?

-yair

-- 
\_________  \_____  \__    \__  \_____         Yair Kurzion
\_________  \_____   \__   \__  \_____         yair++at++sgi.com
       \__     \__   \____\__      \__   http://reality.sgi.com/yair
       \__          \__  \__                Work: (650) 933-6502
       \__          \__   \__               Home: (408) 226-9771
       \__          \__    \__             

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Fri Aug 20 1999 - 12:03:40 PDT

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