2002.08.21 11:30 "Re: OT: large memory allocation in Windows", by Peter Majer
the problem of heap fragmentation cannot be that seldom. what are the standard proven ways to solve it? i am quite surprised about the lack of information on this topic.
the solutions that spring to my mind are:
- 64 bit compilation
- reorganizing memory requirements of the application such that contiguous large blocks are not necessary. E.g. store the data of a large image as an array of rows.
- make sure the application can run for ever with the memory that can be allocated in the beginning. In case of applications working with images, we might allocate the one image we load plus another one for some processing purposes and make sure that we never ever free these and need to allocate new large blocks.
Also, I have been thinking about the third point you mention as a solution as well. Does anyone by chance know if there is an autopointer class out there that is of help with memory reorganization?