jump to beginning show previous Showing Logic-users Thread 4192 of 105804 show next jump to end

Forum Index | Read LUG: Policy/Rules Messages Threads Digests | Post New Message | Search!

From: affe@... (Anssi "Affe" Ahonen)
Date: Mon, 1 Nov 1999 at 4:55:19 PM
Subject: Re: CPU and RAM usage under Logic Audio (LAWP 3.6)
Message #6236
On Mon, 1 Nov 1999 14:01:11 +0100, Darcy Moore <darcy@...> wrote: > >Yes, that's what I'm desperately seeking, a rock solid workstation. So I >can just make music, but unfortunately there seem sot be a lot of techno >problems to resolve first. Re memory managers, how about telling those in >ignorance, like me, why you think they're a con. With a few details. > Ok... here we go :-) 1) It is NOT possible for a windows application to FREE any memory or resources allocated by OTHER programs. There is an API-call which basically asks other processes "please free some memory!", but even in that case, it's up to every process whether they'll do it or not. Usually, they don't. 2) One of the design principles of Windows' memory management is "unused memory is wasted memory". The default behavior is: All free physical memory is allocated by the dynamic disk cache [vcache]. So, it's perfectly NORMAL to have 0 bytes of physical ram available! Windows monitors the total memory load all the time, and if some application is asking for more memory, the OS automatically reduces the size of the vcache. However, this behavior confuses some beginners, and they think "Oh my god! Is windows really eating all my physical ram? Something must be really wrong!" Enter bogus *memory managers*..... 3) The thing they do is basically this: First they monitor the amount of free physical ram. IF the amount goes below a pre-set limit they ALLOCATE a very big chunk of non-swappable memory. Windows notices this and immediately reduces the size of the vcache AND forces memory pages used by other processes to swap file. A few moments later the program frees this big memory chunk again... and ta-dah! We are done! The amount of free physical memory has increased enormously! All is well! Not quite. Let's think what actually happened. Now we have more free (empty, unused, idle) physical ram, right. But, look at the size of your swap file! It has increased accordingly. (Please note, that if you have a fixed-size swap file, you of course don't notice any difference in file size, but the amount of swap-file which is IN USE has increased) So, this operation actually CAUSED swapping. And all this time we have tried to avoid it!. Also, the memory allocated by other processes is NOT freed. It is still allocated, but now pushed to swap-file. Just any reference to these other processes and whrrrrrr!, same more swapping, when these pages are retrieved from the swap. Verdict: *Memory Managers* don't free anything, they just push things to swap file and try to convince you that it is good thing. You see a bigger number for free ram, but you don't see what's happening "under the hood". This scariest thing about this is the fact that the trick is VERY EASY to program. Just a few windows API-calls. Any hacker with Visual Basic can make it in a couple of hours. And these *memory managers* are BIG business. Sad... Any programmer, who is REALLY trying to write a program to free memory (or resources) allocated by OTHER processes, must bypass the operating system calls and hack directly into the windows' internals. Creating such a program without the source-code of windows is quite impossible. Best regards -- Affe - http://www.vip.fi/~affe/ ICQ#31380046
Viewed 279 times, 0 replies, 1 message in thread. Reply to this message.

Forum Index | Read LUG: Policy/Rules Messages Threads Digests | Post New Message | Search!

Forum Index | Read LUG: Policy/Rules Messages Threads Digests | Post New Message | Search!


© 1994-2008, All Rights Reserved.