Ok, so I wrote a test that creates and deletes pixmaps with very various dimensions. I also added breakpoints at gfxAlloc to keep track of where the memory is allocated.
gfxInit();
GDisplay *pixmapDynamic;
pixel_t *surfaceDynamic;
pixmapDynamic = gdispPixmapCreate(100, 100);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(72, 63);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(22, 58);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(44, 87);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(50, 50);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(50, 50);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(100, 100);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(34, 50);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(1, 5);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(3, 10);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(25, 50);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(25, 50);
gdispPixmapDelete(pixmapDynamic);
pixmapDynamic = gdispPixmapCreate(25, 50);
gdispPixmapDelete(pixmapDynamic);
while (1)
;
The allocations seem very weird to me (specially the 53K allocation, largest pixmap is 40K)... See the image included.
It also seems that this issue is very dependent to heap size, the current test was ran with: #define GFX_OS_HEAP_SIZE 60000