[sldev] [VWR] idle_mem_check()
Soft
soft at lindenlab.com
Wed Jul 23 06:34:45 PDT 2008
On Wed, Jul 23, 2008 at 7:32 AM, Robin Cornelius
<robin.cornelius at gmail.com> wrote:
>
> Hey Everyone,
>
> Whist looking through the idle loop i came across the idle_mem_check()
> function. What this does is every frame allocate 10MB of memory in 1MB
> chunks then frees them again, just to check it can.
>
> This seems like a generally bad idea and if you are already hitting swap
> space its going to contribute to a swap storm and lets face it, if you
> can't allocate 10MB your pretty screwed anyway, something going to crash
> or be terminated *very* soon.
>
> I would also imagine this can lead to memory fragmentation (although i
> am blissfully unaware how well OS's cope with this these days).
>
> I did get a small increase in FPS by removing it. My viewer was at
> 5.9-6.0 FPS in a sim with no avatars in or out (or moving) after
> removing the idle_mem_check() i got 7.0 FPS in exactly the same location.
>
> I vote its removed but wanted to see if there are any comments or good
> reasons why it needs to still be there.
To my eye, it looks like some debug code that slipped into release,
and I have mailed the Linden who added this to ask for more details.
Note that it's also going to leak up to 9 megs plus the container when
one of the 1 meg allocations fails, as it bails from the routine
without doing cleanup on the first failure.
More information about the SLDev
mailing list