[fpc-pascal] New object created in custom pool

JoshyFun joshyfun at gmail.com
Tue Oct 28 16:50:00 CET 2008


Hello Jonas,

Tuesday, October 28, 2008, 4:24:56 PM, you wrote:

>>> My application will create thousands of small objects of the same
>>> class, this objects are not created or destroyed in a row, so memory
>>> fragmentation could becomes a serious problem after some time.
>> Since the fpc heap manager itself pools, this should be a non issue.
JM> It depends on how small the instances are.

The "problem" is that most objects are quite small, two pointers and
two int64 values (maybe 2 pointers more in a near future), but it must
be a class instead a record because it could be overriden and
specialized for other minor tasks (minor in the
amount of created objects). The big "but" is that the creation of this
objects will be in blocks of around 100 in average and every each
block some big objects are created and many times allocation pages
seens to be only half filled using the calculator and a rude
aproximation, so I'll try to put all the small objects in a single
block and see what happends with the memory (and also learn a bit more
about fpc ;) ).

-- 
Best regards,
 JoshyFun




More information about the fpc-pascal mailing list