Hi.
In one of my applications I use an array of records (hundreds of items) with 4 memory streams (a few MB each) in each item.
Most of the times the data from one of the streams is backed up in one of the streams (for Undo) and then is modified and the result is copied into the other 2 and into the source stream (in different forms, not exactly the same) - for each item.
There is no way to know the exact size of each stream before the modification (I'm using 3rd party components to compress the data). So I set the size of the stream to the uncompressed data size, compress and then set the size to the value returned by the 3rd party component.
Sometimes items are inserted and/or removed from the array.
The application is 32 bit and using ~ 1.5 GB RAM on 32 bit OSs and ~ 3 GB RAM on 64 bit OSs (large address aware).
But sometimes is not enough, especially when the user is performing a lot of operations on data, fragmenting the memory.
I use now Delphi XE8 with the default memory manager (FastMM4).
For very good reasons I can't make a 64 bit application so I'm stuck with 32 bit.
My current OS is Windows 8.1 x86.
I searched before asking but couldn't find anything useful.
Once I tried to make a custom TMemoryStream, didn't work.
Any tip on how to lower the memory fragmentation?
Thank you in advance.
In one of my applications I use an array of records (hundreds of items) with 4 memory streams (a few MB each) in each item.
Most of the times the data from one of the streams is backed up in one of the streams (for Undo) and then is modified and the result is copied into the other 2 and into the source stream (in different forms, not exactly the same) - for each item.
There is no way to know the exact size of each stream before the modification (I'm using 3rd party components to compress the data). So I set the size of the stream to the uncompressed data size, compress and then set the size to the value returned by the 3rd party component.
Sometimes items are inserted and/or removed from the array.
The application is 32 bit and using ~ 1.5 GB RAM on 32 bit OSs and ~ 3 GB RAM on 64 bit OSs (large address aware).
But sometimes is not enough, especially when the user is performing a lot of operations on data, fragmenting the memory.
I use now Delphi XE8 with the default memory manager (FastMM4).
For very good reasons I can't make a 64 bit application so I'm stuck with 32 bit.
My current OS is Windows 8.1 x86.
I searched before asking but couldn't find anything useful.
Once I tried to make a custom TMemoryStream, didn't work.
Any tip on how to lower the memory fragmentation?
Thank you in advance.