[SDL] RLE Compression

Donny Viszneki donny.viszneki at gmail.com
Sun Apr 12 09:45:14 PDT 2009


On Sun, Apr 12, 2009 at 8:28 AM, Rudolf Janz <rudolf.janz at gmx.net> wrote:
>> That's a shame. shrinking the most recently allocated chunk of memory
>> should not cause memory fragmentation!
>> A good libc allocator should not have a hard time with either approach.
>
> It happens if there are other threads doing allocations.

This makes sense. I think for most applications, a better allocation
heuristic would be to accept a little more average overhead, and avoid
the memory fragmentation from concurrent allocator accesses by giving
each thread its own space within which to allocate. (There's certainly
room for more detailed heuristic analysis on how best to do that,
though.)

> But even without other allocations, if realloc does not move the memory block, the amount of contiguous virtual memory is reduced,

This is precisely the behavior I was criticizing. Good allocators
shouldn't do this.

> On Windows CE it is just 32MB with around 10-12 MB already prefragmented (because of an incredibly stupid shared library loading mechanism)

ugh

> In my case the avoiding the large estimates solved the out of memory problems.

:)

-- 
http://codebad.com/



More information about the SDL mailing list