Resources | Resources |



Testing memory fragmentation

Testing is, of course, an important part of the development process. Brew MP developers should ensure that they include testing for fragmentation as a part of their standard process.

The simplest way to check for memory fragmentation is through the GETRAMFREE() helper function. This function returns the total amount of free memory in the system heap, as well as the size of the largest free block. By looking at the difference between these two values, applications can detect memory fragmentation.

As mentioned above, the most important points at which to test for fragmentation are when the application is launched, when it is suspended, and when it is backgrounded.