From: Yair Kurzion (yair++at++polygon.engr.sgi.com)
Date: 06/03/2002 13:58:42
Hi Tien !
The PFB loader keeps a pointer to all pfTexture objects that it creates while
loading a model. It uses these pfTexture pointers for sharing texture maps
among your various models. This means that your pfTexture's are kept even after
you delete the model.
- You can disable texture sharing completely using
pfdConverterMode("pfb", PFPFB_SHARE_GS_OBJECTS, PF_OFF).
- If you want your PFB loader to share textures, you can clean the internal
PFB loader pfTexture list by calling pfdCleanShare_pfb.
For examples of deleting scene graph portions, take a look at:
/usr/share/Performer/src/pguide/libpf/C/deleteTBox.c
/usr/share/Performer/src/pguide/libpf/C/deleteGraph.c
Both programs show the best way for deleting a scene graph chunk.
-yair
> i seem to be having memory leak when using pfDelete('node')
> where 'node' is loaded using pfdLoadFile()
> is this because of loader? how do i delete the missing memory?
> below is the extracted code with printout
>
> regards
> tien
>
> ...init_config_code
>
> pfFrame();
> printf("before loading = %d\n", pfGetMemoryArenaBytesUsed()); //
> before loading = 580954
> node = pfdLoadFile("./esprit.pfb");
> printf("after loading = %d\n", pfGetMemoryArenaBytesUsed());//after
> loading = 1094301
> pfDelete(node);
> for(i=0; i<10; i++)
> pfFrame();
> printf("after pfDelete = %d\n", pfGetMemoryArenaBytesUsed());//after
> pfDelete = 667989
>
> ...exit_code
>
> -----Original Message-----
> From: MLM Veraart [mailto:veraart++at++fel.tno.nl]
> Sent: Friday, 31 May 2002 7:50 PM
> To: Ozarka Simatomi
> Cc: Performer Mailing List
> Subject: Re: [info-performer] pfMemory::new() fails
>
>
> Ozarka Simatomi wrote:
> >
> > Hi,
> > This is kind of an emergency.
> > I got the following error message:
> > pfMemory::new() unable to allocate 100832 bytes
> > from arena 0x44000. Try use pfSharedArenaSize() to
> > increase the arena size (currently 262144.00
> > KBytes)...
> > Does this mean there is memory leakage in my
> > application?
> > The program can run for a couple of hours without
> > a problem, but sometimes it crashed with above
> > message, or it crashed and the whole system crashed
> > (Octane with IRIX).
> > My Performer program also sproc() off two other
> > processes. If there is memory leakage in other
> > processes, will this affect the Performer program?
> > It looks like I don't have this problem until I
> > am displaying my virtual reality scene on a seperate
> > monitor.
> > Thanks a lot!
> >
>
> You probably are suffering from memory fragmentation in shared memory.
> This is due to malloc and free of datastructures.
> The thing you can do is set a few amallopt() calls. See the man page.
>
> Mario
>
--
\_________ \_____ \__ \__ \_____
\_________ \_____ \__ \__ \_____ Yair Kurzion
\__ \__ \____\__ \__ yair++at++sgi.com
\__ \__ \__ (650) 933-6502
\__ \__ \__
\__ \__ \__
This archive was generated by hypermail 2b29 : Mon Jun 03 2002 - 13:59:16 PDT