On 28 Oct 2008, at 16:50, JoshyFun wrote:

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

100 bytes and smaller are most certainly handled using pools by FC's heap manager.

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

The calculator and which base size? Did you call instancesize to see how much space is required for each instance?


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to