Resetting RAM

Posted:
in Genius Bar edited January 2014
I just ran into this problem:

After running a number of applications while simultaneously surfing the internet, I ran into an out of memory error. I don't have very much memory (160 MB), but it's enough to run numerous small apps and two or three big ones, plus the system software (of course!). I think the problem is that certain applications use RAM and still have data stored in it, but they don't remove the data when you quit. So even after quitting iTunes, QuickTime, SimpleText, AppleWorks, I still had only 12 MB free. The amount used and the largest unused block added up to much less than the total available RAM.



Is there any way to reset the RAM without restarting the computer?



[edit]Just thought of something. I'm not sure if this is the case, but when one app needs RAM and another app that's already been quit out of is using some RAM, does the new app push the old app's data out of the RAM to use it, or is it strictly off-limits once it's there? i.e. I quit iTunes, and there's only 12 MB free, and Mozilla needs an extra 20 MB, does Mozilla push 8 MB of iTunes' data out of RAM to use for itself?



[ 06-02-2002: Message edited by: Luca Rescigno ]</p>

Comments

  • Reply 1 of 2
    ghost_user_nameghost_user_name Posts: 22,667member
    This has to do with Classic Mac OS's memory fragmentation -- something I will explain in greater detail as soon as I finish these diagrams.
  • Reply 2 of 2
    ghost_user_nameghost_user_name Posts: 22,667member
    Mac OS allocates memory to apps in long, contiguous blocks. When an app is launched, it takes a part from the largest available contiguous block of memory. Because of this rather simplistic method, though, memory can become fragmented and you may appear to have less available than you really do.



    Okay, here's your memory when you start up your computer. Now, I haven't used OS9 in over a year; so, I'm guessing at the amounts of memory for each app. I'm also using round figures to make illustration easier.







    Let's say you launch Internet Explorer (10 MB), SimpleText (5 MB), AppleWorks (15 MB), iTunes (10 MB), and Photoshop (40 MB). This is what your memory will look like:







    In "About This Mac", you'd see 40 MB as the available memory. Now, let's say you quit Internet Explorer (or it crashes -- heh). Your memory will now be:







    Because the two free memory blocks are not contiguous, you still will only see 40 MB available (because that's now the most the OS can allocate to a single app). Remember that I said above that the OS will load new apps into the largest available block -- which is the 40 MB on the right. So, if you relaunch Internet Explorer, you'll get this:







    Now it gets fun. Let's say you quit both AppleWorks and Photoshop. They're both big apps; so, wouldn't you think that should clear up a lot of memory? Well, take a look:







    The largest available contiguous block is now 40 MB again, in the spot where you just quit Photoshop. Let's relaunch AppleWorks:







    Now, the largest block is at the end, of only 30 MB! What happens if you try to launch Photoshop now? Well, you can't! It needs a contiguous block of 40 MB.



    This is what is called memory fragmentation, as you can see the free memory is broken up into smaller chunks. Clearly this has been one of the Mac OS's *major* drawbacks over the years. Ideally, you could just quit all open apps and you'd be left with your original 120 MB of free memory. Well, Classic Mac OS and its apps are not ideal. Internet Explorer, for example, tends to invisibly eat up memory that doesn't belong to it, causing further fragmentation. The Finder also does this as well as several other apps, I'm sure. Thus, you can sometimes end up with only a few MB available even after quitting all your open apps.



    Unfortunately, the only way to "flush" the memory is to reboot.



    Mac OS X's memory architecture is lightyears ahead of Classic's, dynamically allocating and swapping around th available memory blocks. Of course, I'm sure if you *could* run X, you probably would -- but like I said, this isn't an ideal world.



    Well, I hope this has been a helpful lesson to ya'. Feel free to ask any questions and I'll try to answer them to the best of my knowledge.



    [ 06-02-2002: Message edited by: starfleetX ]</p>
Sign In or Register to comment.