THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/10/2005 at 10:29, xxxxxxxx wrote:
Not garbage collection, just a way to place many class instances (my own, not C4Ds) into a particular MemoryPool in order to avoid memory fragmentation. Generic memory allocations can be done into the MemoryPool, but classes require placement new for such a task.
I am prepassing to count as much as possible to allocate larger blocks of memory, but there are still fragmentation issues since I am allocating many temporary blocks for processing/compressing/decompressing interspersed with creation of permanent C4D objects. The memory requirements for any file are not completely quantifiable - could be virtually nothing to gigabytes. These files reference other files in turn which only logarithmically complicates the process.
One person in an article mentioned one way is to allocate all permanent memory (C4D objects) first and transient memory (parsing classes and whatnot) afterwards. This is an impossibility when dealing with this flexible, hierarchical, extrareferential file format. There is no way to know of all of the permanent needs until after parsing the entire file (and its referenced files) and doing some complex determinations (the same complex determinations that constitute the plugin itself). So, I'd practically need to run the entire process twice which would incur some form of memory usage to store information to reduce memory usage (etc., etc.) as well as an unacceptable slow down for users.
It's not really a matter of allocation speed as usage. There are no leaks, it is just that system reclamation is very slow.