Help with PFMemory!

New Message Reply Date view Thread view Subject view Author view

DAS (dchism++at++d-a-s.com)
Thu, 16 Sep 1999 16:24:01 -0400


I am working on an application that tessellates polygonal structures and
deforms them in real time. Currently the biggest problem is that memory
becomes fragmented very quickly. In fact, if I never free the memory I
allocate, it runs approx 4/5 as long as when I free the memory after it
is not being used. There are no memory leaks, as all the pfMalloc and
pfDelete calls are in 1 function. The problem is that when the new data
is created I need to create space for normals, texcoords, colors,
vertex-indices and triangles, and get rid of the old structures. Because
each of these is created with its own pfMalloc, they are all fairly
small memory allocations, which then fragment the memory badly - making
it almost unusable once free'd. Part of this is the application's fault,
as it tends to need larger memory the longer it runs. A way of helping
the matter would be to add up all the size I need for all of the data,
then only make one pfMalloc for all of the data, then offset the
pointers based on how much memory each attribute needs. This, combined
with padding each pfMalloc up to the next 16k boundary, would allow me
to reuse a LOT more memory since it would not fragment nearly as bad.
The problem is that the pfGSetAttr functions need a full pfMemory
structure with the header so it can keep track of the ref counts. I need
less memory fragmentation much more than I need performer to keep track
of my memory ( I have switched from pfDelete to pfFree and encounter no
errors since all the memory is created/destroyed in 1 function and it
does it in the right order ). Is there any way to use pfMemory and
pfGSetAttr without having the pfMemory header and ref counts? I dont
care if it is some low level hack - I need to reuse that memory! Thanks
for any help.

Doug Chism
Lead Systems Engineer
Dynamic Animation Systems


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu Sep 16 1999 - 13:26:19 PDT

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