Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xDiehardx

macrumors newbie
Aug 18, 2009
2
0
Tried some things

Alright, first off, on the activity monitor under Page IN/Out's:
After a few reboots and using of programs it seems the Page in is roughly 2x the page out. (540,000/263,000 etc.)

Secondly I've been quitting the program with file quit, or right clicking on the icon in the (docking bar i think?) and telling it to quit. Usually ill check the resource monitor to make sure photoshop is removed from the process list.

Third, I've tried repairing the hardrive's permissions. It repaired alot of permissions without issues, but that didn't help. When I tried to use the Repair disk option (from booting off the OSX Disk), I get the Volume Bit map needs minor repair issue error. After multiple attempts Disk Utility cant get around or fix it.

I've been looking around alot on this issue, and apparently its very vague what causes this error. On top of that the only solution I can find, seems to be buying a $100 application, from what I've read, only sometimes works.

Would a volume bit map issue cause this kind of performance killing?


My major issue is this is the computer where I work, so I cant spend hours upon hours messing around with settings like I can on my home PC. Also, since money is tight, convincing my boss to spend $100 on something that "might" work, is also outa the question. Especially when it may not even be the solution to the extreme slowdown.


A little further on the ram issue. 1.5 gigs of ram definitely isn't anywhere near what I'd like to see, but when the only application I'm running is photoshop, it should be enough to get by. I've had Photoshop CS3 run just fine on my old cup holder at home (P4 1.5ghz - 1gig of ram)

Also, not having quite enough ram on photoshop should only really slow down the time required to complete certain tasks. It doesn't explain how the computer is extremely slow when I don't even have a file in photoshop open. Photoshop running, with no files open within it, "shouldn't" cause a complete slowdown to the point where it takes 10+ seconds for the the File menu to open up. (Other things like safari, the docking bar, dashboard also become extremely unresponsive).

Also I've read up on safari having some major memory leak issues, so just to clarify I don't keep it running in the background. I also have no gadgets or apps running (other then what's on by default with OSX install)



Sorry for going on so long! lol. Just trying to leave enough info for people to work with.

Again, ,major thanks in advance for any help.
 

lisamariet

macrumors newbie
Sep 6, 2009
2
0
I am also having problems with my MacBook pro running slowly when opening new apps and I am having little free ram.

I really wish my MAC would be fast all the time just like it was in the beginning... but it is not any more. It is weird really... as I understand what has been explained on how the memory works on MAC... Unfortunately it does not run very smoothly on my MAC. I am pretty sure that it has to do with t he programs I am running.

However... maybe someone could explain more about the page outs and page ins? I looked in my Activity Monitor and it currently says:
VM size: 50.78 GB
Page ins: 174.62 MB
Page outs: 16.92 MB
Swap used: 9.41 MB

Free: 10.40 MB
Wired: 442.81 MB
Active: 676.81 MB
Inactive: 2.90 GB

So according to the cake diagram currently 3/4 of my system is inactive memory right now.

(I have 4GB of RAM installed)

And I just did a reboot. Then started up Safari and Firefox, and off course Activity Monitor. There is a couple of other services I have installed too: Microsoft Live Sync, LogMeIn, QuickSilver and EverNote. Other than that everything should be standard.

I use VMWare Fusion and I would not dream to open up a VM now as I know by experience it will be insanely slow and slow down my entire MAC. Because of this I have stopped using VM's and also stopped using my MAC for work as it is too slow and unusable. However I find that it gets slow anyways... even from just normal lite usage like.. playing music, looking at pictures, using chat clients. Then suddenly it will become very slow. I find that Firefox is using a lot of virtual memory (over 1 GB) and I suspect that he is the cause of memory problems. So if I do want to use my VM image I must be sure NOT to have firefox opened... neither Flock which I also used occasionally. In the beginning I would have both firefox and Flock opened at the same time and everything was quick and fantastic. If I try that now... forget it... it will take like 10-15 minutes before they are both opened and that I can actually use the MAC for anything... and it will be very very slow.

So I already know that Firefox and Flock are huge memory huggers. so no need to tell me that. So because I know this I often close them down.. Quiting... before I open something else up... however I still find my MAC to be slow.. not AS slow as if I had them open, but still... slow. Slower than it was in the beginning when I got it.
 

zgtuner

macrumors newbie
Nov 18, 2009
1
0
Haloooo, wake up...

Unbeliveable!!!! This discussion is going for years as I can see.

Some guys saying that Mac simply slowes down and does not perform, and
other "clever" guys telling the tales about how it SHOULD be.

Don't they understand that it is not as it should be in many cases.

The system simply does not release inactive memory when this is required. Full stop.
And what is design doing to improve this all this years.....

What a shame that I have to read from forums like this what does it mean wired and what does it mean inactive. No singe word about it on Mac user guides.

Try search on Macc webpage on "what is wired memory"
and you will get response
do you mean "what is weird memory".....
Hi Hi .. congratulations

Be happy



I am also having problems with my MacBook pro running slowly when opening new apps and I am having little free ram.

I really wish my MAC would be fast all the time just like it was in the beginning... but it is not any more. It is weird really... as I understand what has been explained on how the memory works on MAC... Unfortunately it does not run very smoothly on my MAC. I am pretty sure that it has to do with t he programs I am running.

However... maybe someone could explain more about the page outs and page ins? I looked in my Activity Monitor and it currently says:
VM size: 50.78 GB
Page ins: 174.62 MB
Page outs: 16.92 MB
Swap used: 9.41 MB

Free: 10.40 MB
Wired: 442.81 MB
Active: 676.81 MB
Inactive: 2.90 GB

So according to the cake diagram currently 3/4 of my system is inactive memory right now.

(I have 4GB of RAM installed)

And I just did a reboot. Then started up Safari and Firefox, and off course Activity Monitor. There is a couple of other services I have installed too: Microsoft Live Sync, LogMeIn, QuickSilver and EverNote. Other than that everything should be standard.

I use VMWare Fusion and I would not dream to open up a VM now as I know by experience it will be insanely slow and slow down my entire MAC. Because of this I have stopped using VM's and also stopped using my MAC for work as it is too slow and unusable. However I find that it gets slow anyways... even from just normal lite usage like.. playing music, looking at pictures, using chat clients. Then suddenly it will become very slow. I find that Firefox is using a lot of virtual memory (over 1 GB) and I suspect that he is the cause of memory problems. So if I do want to use my VM image I must be sure NOT to have firefox opened... neither Flock which I also used occasionally. In the beginning I would have both firefox and Flock opened at the same time and everything was quick and fantastic. If I try that now... forget it... it will take like 10-15 minutes before they are both opened and that I can actually use the MAC for anything... and it will be very very slow.

So I already know that Firefox and Flock are huge memory huggers. so no need to tell me that. So because I know this I often close them down.. Quiting... before I open something else up... however I still find my MAC to be slow.. not AS slow as if I had them open, but still... slow. Slower than it was in the beginning when I got it.
 

theshadow27

macrumors newbie
Dec 10, 2009
7
0
I've read through this thread and don't want to get wrapped up with the argument of how amazing Apple/BSD is with managing memory. Fact is that I have a 17" unibody MBP and when Safari has been running 30-40 tabs for a few days it doesn't release memory properly when it closes. I have 8gb so it's not usually a problem, but if I'm running VMware (2gb) with NetBeans (2gb) and Safari (2-3gb) then it gets a little tight.

From my informal tests, the system is more responsive when running with "Free Memory" than "Inactive Memory." As a computer scientist and electrical engineer to me the reason for this is fairly straight forward. When the Kernel has free memory to work with, it can allocate it without thinking. When it's inactive memory, no matter how fast/efficient/wonderful the MMS is, it still has to page out that data. What "clearing the inactive ram" means to me is:
Forcing the Apple MMS to preemptively page inactive memory to disk so it is not done at the time of allocation.

Now that that's out there, here's how I did it. It's in two parts, mostly because I'm rusty at C and found a ruby program that didn't work. Here's the C++:

Code:
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <string>
using namespace std;

int main (int argc, char * const argv[]) {
	if(argc <2){
		std::cout << "Must specify size in bytes\n";
		return 1;
	}
	
	// allows full memory space usage
	long size, i, ints;
	
	// size in bytes, parsed from the int
	size = atoll(argv[1]);
	// calculate the number of unsigned ints this will occupy
	ints = size / sizeof(unsigned int);
	// give a nice value printout
	std::cout << "Allocating "<< size << " bytes ("<<ints << "ints)\n";
	
	// allocate the memory
	unsigned int* mem;
	mem = (unsigned int*) malloc(size);
	
	// in OS X you have to use it for it to count
	for (i=0; i<ints; i++) {
		mem[i] = rand();
	}
	
	// free it up. 
	free(mem);
    return 0;
}
This code allocates a certain number of bytes of live memory (passed in as an argument) and fills it with random numbers. It then frees it properly with the "free()" call (which, by the way, Safari 4.0.4 does not do).

The next part I admittedly stole most of from here. It's just a Ruby script to read in the results from "vm_stat" and figure out how many bytes to malloc. There's a few reasons that it's not all in Ruby, (1) because the Ruby version was very slow and (2) because it didn't work with 10.6 (don't know about whatever 10.x was in 2006). So my version of the shell script just calls the above executable:

Code:
#! /usr/bin/ruby

puts "Beginning inactive memory free routine"

vm_stat = `vm_stat`

vm_stat = vm_stat.split("\n")

page_size = vm_stat[0].match(/(\d+) bytes/)[1].to_i

pages_free = vm_stat[1].match(/(\d+)/)[1].to_i
pages_inactive = vm_stat[3].match(/(\d+)/)[1].to_i


bytes_to_read = page_size*pages_free + page_size*pages_inactive

puts "Free pages:       " + pages_free.to_s
puts "Inactive pages:   " + pages_inactive.to_s
puts "Allocating bytes: " + bytes_to_read.to_s + " (" + (bytes_to_read/(1024*1024*1024.0)).to_s + "gb)"

cmd =  "allocate " + bytes_to_read.to_s
system(cmd)

sleep(3)

vm_stat = `vm_stat`.split("\n")
pages_inactive = vm_stat[3].match(/(\d+)/)[1].to_i
puts "All done. Now there are " + pages_inactive.to_s + " inactive pages."

I compiled the C++ in a file called "allocate.cpp" (executable was just "allocate" - created using an XCode project although you could probably do it with gcc) and the ruby is in "inactive.sh". When I close a program and want to get rid of the blue, I just run "inactive.sh". I've attached the XCode project and the Ruby script with the hope that it saves someone the trouble. Cheers,

JSD
 

Attachments

  • inactive.zip
    327.1 KB · Views: 298

vhato

macrumors newbie
Jan 18, 2010
3
0
I've read through this thread and don't want to get wrapped up with the argument of how amazing Apple/BSD is with managing memory. Fact is that I have a 17" unibody MBP and when Safari has been running 30-40 tabs for a few days it doesn't release memory properly when it closes. I have 8gb so it's not usually a problem, but if I'm running VMware (2gb) with NetBeans (2gb) and Safari (2-3gb) then it gets a little tight.

From my informal tests, the system is more responsive when running with "Free Memory" than "Inactive Memory." As a computer scientist and electrical engineer to me the reason for this is fairly straight forward. When the Kernel has free memory to work with, it can allocate it without thinking. When it's inactive memory, no matter how fast/efficient/wonderful the MMS is, it still has to page out that data. What "clearing the inactive ram" means to me is:
Forcing the Apple MMS to preemptively page inactive memory to disk so it is not done at the time of allocation.

Now that that's out there, here's how I did it. It's in two parts, mostly because I'm rusty at C and found a ruby program that didn't work. Here's the C++:

Code:
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <string>
using namespace std;

int main (int argc, char * const argv[]) {
	if(argc <2){
		std::cout << "Must specify size in bytes\n";
		return 1;
	}
	
	// allows full memory space usage
	long size, i, ints;
	
	// size in bytes, parsed from the int
	size = atoll(argv[1]);
	// calculate the number of unsigned ints this will occupy
	ints = size / sizeof(unsigned int);
	// give a nice value printout
	std::cout << "Allocating "<< size << " bytes ("<<ints << "ints)\n";
	
	// allocate the memory
	unsigned int* mem;
	mem = (unsigned int*) malloc(size);
	
	// in OS X you have to use it for it to count
	for (i=0; i<ints; i++) {
		mem[i] = rand();
	}
	
	// free it up. 
	free(mem);
    return 0;
}
This code allocates a certain number of bytes of live memory (passed in as an argument) and fills it with random numbers. It then frees it properly with the "free()" call (which, by the way, Safari 4.0.4 does not do).

The next part I admittedly stole most of from here. It's just a Ruby script to read in the results from "vm_stat" and figure out how many bytes to malloc. There's a few reasons that it's not all in Ruby, (1) because the Ruby version was very slow and (2) because it didn't work with 10.6 (don't know about whatever 10.x was in 2006). So my version of the shell script just calls the above executable:

Code:
#! /usr/bin/ruby

puts "Beginning inactive memory free routine"

vm_stat = `vm_stat`

vm_stat = vm_stat.split("\n")

page_size = vm_stat[0].match(/(\d+) bytes/)[1].to_i

pages_free = vm_stat[1].match(/(\d+)/)[1].to_i
pages_inactive = vm_stat[3].match(/(\d+)/)[1].to_i


bytes_to_read = page_size*pages_free + page_size*pages_inactive

puts "Free pages:       " + pages_free.to_s
puts "Inactive pages:   " + pages_inactive.to_s
puts "Allocating bytes: " + bytes_to_read.to_s + " (" + (bytes_to_read/(1024*1024*1024.0)).to_s + "gb)"

cmd =  "allocate " + bytes_to_read.to_s
system(cmd)

sleep(3)

vm_stat = `vm_stat`.split("\n")
pages_inactive = vm_stat[3].match(/(\d+)/)[1].to_i
puts "All done. Now there are " + pages_inactive.to_s + " inactive pages."

I compiled the C++ in a file called "allocate.cpp" (executable was just "allocate" - created using an XCode project although you could probably do it with gcc) and the ruby is in "inactive.sh". When I close a program and want to get rid of the blue, I just run "inactive.sh". I've attached the XCode project and the Ruby script with the hope that it saves someone the trouble. Cheers,

JSD

It seems we are on the same page and from your message it appears you have an application that can free inactive ram.

I just wish I knew how execute it.
 

theshadow27

macrumors newbie
Dec 10, 2009
7
0
It seems we are on the same page and from your message it appears you have an application that can free inactive ram.

I just wish I knew how execute it.

No offense intended, but if you're unsure how to run a C++ program you probably shouldn't mess with this. Allocating massive amounts of RAM (how the program works) is inherently unsafe and can absolutely crash your computer.

If you're sure you want to try anyway, and accept the liability of potential damage:
1) Save the first program as UTF-8 in TextEdit.app to some folder as a file called "inactive.cpp".
2) Using Terminal.app, navigate to the folder that you saved ("cd" to change directory, etc...) and type "cc -o inactive inactive.cpp" (return)
3) Save the second program as UTF-8 in TextEdit.app to something like "inactive.sh" in the same folder as the original
4) Using Terminal.app (in the same folder as before) type "chmod 755 inactive.sh" (return) to set the script executable.

To run the program, from Terminal.app just run "./inactive.sh" (return)

I just use a magnet from a speaker.
Funny. Unfortunately that stopped working when I got the 256gb SSD :rolleyes:
 

theshadow27

macrumors newbie
Dec 10, 2009
7
0
On a side note - I haven't had to use this since 10.6.2 pushed. They fixed something, Safari is behaving much better. I still have to quit every 8 hours or so when it gets up to 1200MB active, but at least it cleans up after itself now.
 

ghostlines

macrumors regular
Feb 3, 2010
155
14
Amsterdam
I understand the MMS's reason for storing inactive RAM. But I believe it's a fact that if free RAM is low, opening new apps goes terribly slow, and the system feels sluggish at times. So the MMS idea is good but some how it's not releasing inactive RAM fast enough(or just isn't) to open new apps.

This is annoying to users who have alot of RAM, and in particular alot of inactive RAM lying around doing "nothing".

I think appropriate thresholds should be in place to set a maximum amount of allowed inactive RAM based on the total amount of RAM and whatever other needed variables.
 

theshadow27

macrumors newbie
Dec 10, 2009
7
0
I understand the MMS's reason for storing inactive RAM. But I believe it's a fact that if free RAM is low, opening new apps goes terribly slow, and the system feels sluggish at times. So the MMS idea is good but some how it's not releasing inactive RAM fast enough(or just isn't) to open new apps.

This is annoying to users who have alot of RAM, and in particular alot of inactive RAM lying around doing "nothing".

I think appropriate thresholds should be in place to set a maximum amount of allowed inactive RAM based on the total amount of RAM and whatever other needed variables.

Unfortunately there is no way to do this accurately with programs written in C/C++ derived languages (like OS X, and the majority of the applications that run on it). Such languages have origins before multi-thread capable systems, where it was desirable for a program to use as much memory as it required. Thus they were designed so memory is allocated programmatically using statements like "malloc" before use, and freed with statements like "free." The computer does not, and can not, keep track of what memory is actually being used - that responsibility lies solely with the application. This was not an issue when the computer reset the whole memory space between jobs, but has created a few problems today.

What we see displayed as "active" and "inactive" memory is just an estimation based on time of last access. This is a primitive technique from the early days of paging to increase cache hit efficiency. "Inactive" memory just means that the data stored there has not been accessed within the last N cycles.

The only way around this problem is using an exact garbage collection scheme, such as implemented within the Java JVM. In this system, the programmers no longer have to allocate memory, or guess when it's being used; the garbage collector takes care of it automatically. In an exact GC setup, the machine knows exactly which memory can be used again and which can not, and thus occasionally but regularly returns the inaccessible memory to a common pool.

While garbage collection schemes exist for C-type languages, they are conservative collectors - they don't know where all memory pointers are located. They can often do a better job than the programmers themselves, but are nowhere near as efficient as the exact collectors. Without a full picture of the program code AND the memory it uses, they err on the conservative side - leaving memory allocated.

So basically as long as OS X is written in C, we will have to deal with inactive memory. There are no thresholds or variables to tinker with, the information just isn't there.
 

ghostlines

macrumors regular
Feb 3, 2010
155
14
Amsterdam
Unfortunately there is no way to do this accurately with programs written in C/C++ derived languages (like OS X, and the majority of the applications that run on it). Such languages have origins before multi-thread capable systems, where it was desirable for a program to use as much memory as it required. Thus they were designed so memory is allocated programmatically using statements like "malloc" before use, and freed with statements like "free." The computer does not, and can not, keep track of what memory is actually being used - that responsibility lies solely with the application. This was not an issue when the computer reset the whole memory space between jobs, but has created a few problems today.

What we see displayed as "active" and "inactive" memory is just an estimation based on time of last access. This is a primitive technique from the early days of paging to increase cache hit efficiency. "Inactive" memory just means that the data stored there has not been accessed within the last N cycles.

The only way around this problem is using an exact garbage collection scheme, such as implemented within the Java JVM. In this system, the programmers no longer have to allocate memory, or guess when it's being used; the garbage collector takes care of it automatically. In an exact GC setup, the machine knows exactly which memory can be used again and which can not, and thus occasionally but regularly returns the inaccessible memory to a common pool.

While garbage collection schemes exist for C-type languages, they are conservative collectors - they don't know where all memory pointers are located. They can often do a better job than the programmers themselves, but are nowhere near as efficient as the exact collectors. Without a full picture of the program code AND the memory it uses, they err on the conservative side - leaving memory allocated.

So basically as long as OS X is written in C, we will have to deal with inactive memory. There are no thresholds or variables to tinker with, the information just isn't there.

I understand the limitations you mentioned concerning garbage collection. But to my understanding of earlier posts in this thread and this link http://developer.apple.com/mac/libr...tual/ManagingMemory/Articles/AboutMemory.html is that OS X stores inactive memory so that if you reopen an app recently used it can launch quicker.

I don't think that as long as OS X is written in C we have to deal with this problem. The MMS scheme could maybe be altered to allow closed apps to free their memory so other apps can use it much quicker. Having more ram on a system means that more apps can be ran simultaneously without/with less slowdown.

The MMS scheme that OS X uses(by saving app data in mem to let them reopen quicker) doesn't allow you to run the same amount of apps, and same group of apps, at the same time with the same "snappiness"/response time.
The speed of my system i.e. user experience shouldn't be dependent on the order in which I run a specific group of apps.

For example I have 4gb RAM total, and I allocate 1 gig to my VM. My freemem was 45mb's and inactive was 2.04gb at the time. It took the system very long to start up VMware and then the VM. Because the system took too much time releasing 1 gig of inactive memory that could of been free in the first place.

Imo the system should only struggle when I'm swapping memory, when reaching the limits of my total physical memory. And according to link they're thresholds that certain activities are based on.
 

micronuts

macrumors newbie
Feb 17, 2010
1
0
Inactive memory is a problem

Honestly, you don't need to worry about the inactive RAM. OS X handles memory much better than Windows. When you open a new app that requires memory, OS X will switch out the inactive RAM in the background. Unless you have oodles of RAM and very few applications open, you'll generally find you have less than 100MB free. OS X will use as much as it can whenever possible but since it's good at the inactive stuff, you shouldn't notice too much.

Those widgets are taking up quite a bit of RAM but that's probably more to do with the way in which they're coded. You could close them if it bothers you and reopen them.

I have to disagree.

For the last two years my macbook os x tiger was performing flawlessly with great response. In the last two months I've noticed the following applications loading slowly

- FF
- Safari
- Mail
- Moodex

Well, almost every app.

So I started checking memory usage. And the common factor is that free memory came right down to a few k, from 300K or so, and INACTIVE memory staid the same! Upwards of 300K.

So what do you think is causing this slowdown!? When I close a few apps, like Safari, Mail, then free memory goes back up to 300K or so (I have over 1Gb of RAM), but inactive memory is still quite high.

Please explain.

js
 

vinayakaya

macrumors newbie
Mar 10, 2010
1
0
Fanboy Credibility Issues

I have to say, this thread is the perfect example of the infamous fanboy syndrome. Claiming that Macs have great memory management and that the way it deals with inactive memory is "how it is supposed to be" is just ludicrous.

I have 4 gigs of memory, and by the end of any given day my memory is full, and shutting down all major software does NOT free that memory. This is NOT good memory management! In fact this implies serious memory leaks.

I wish people would stop making a computer company into their religion and deal with the real problems that do exist in this OS.

Yes it is better than microsoft, but if it wants to maintain that advantage then they can't afford to ignore its shortcomings. Furthermore if Mac fanboys want to maintain any shred of credibility then they have to be objective and stop defending Apple unconditionally.

PS. To make the point clearer, I installed that program ifreemem that someone mentioned on this post and it freed up 2 gigs of memory! You could take this as praise to the ifreemem software, but in reality it should send a message loud and clear to Mac and the fanboys : Mac memory management can and should be improved!
 

anand.mundewadi

macrumors newbie
May 27, 2010
1
0
About Mac Os

I am facing problem when i am exicuting programs with xCode. if anyone knows problems regarding Flock files
 

dyn

macrumors 68030
Aug 8, 2009
2,708
388
.nl
I have to say, this thread is the perfect example of the infamous fanboy syndrome. Claiming that Macs have great memory management and that the way it deals with inactive memory is "how it is supposed to be" is just ludicrous.
This thread is the perfect example of a lot of people not understanding memory management at all. There are exceptions because some people actually care to explain the details of memory management where they also point out that there are indeed some problems with it. However everybody who understands memory management does agree on one thing: it IS supposed to work like that. That still doesn't mean it is the right way of doing it as you can clearly tell by the discussion about whether the way it is supposed to work is the right way of doing it. Your post is rather ludicrous.

I have 4 gigs of memory, and by the end of any given day my memory is full, and shutting down all major software does NOT free that memory. This is NOT good memory management! In fact this implies serious memory leaks.
No it doesn't. It's part of how the memory management works: it keeps things in memory. There are some problems where not all of the memory is regained by other software. Memory leaks would be something differently: Firefox has had some of those in the past. Firefox took up a lot of memory when you fired it up and kept eating memory when it was running. That is memory leaking. It was easy to resolve: quit Firefox.

In the end it's about being able to run software properly. I have memory filled up most of the time but in my 4 years of using a Mac I haven't had any memory related problems other than a defective memory module (it caused kernel panics). The Macs were as fast as when I had just booted them. I'm always using the sleep function, it was actually one of the main reasons for getting a Mac.

Too bad there are still people who only judge things by their specs and the amount of free memory instead of the overall performance of the device. In the end it's not the specs and not the amount of free memory that counts, it's what the machine does with it. You absolutely fail in every aspect regarding the overall performance. You fail to research what the amount of free memory and the amount of inactive memory does for your performance. Luckily there are other people in this thread who did research like that and posted their results. I'd rather read their posts as they are informative and just a flame like yours obviously is. You don't point out why memory should be released after a program stops running.

I wish people would stop making a computer company into their religion and deal with the real problems that do exist in this OS.
I wish people like you would indeed stop doing that and stop spreading false information. As you can tell in this thread a lot of people have showed why it works the way it works and that there are some flaws. That quite shows the opposite of "hear no evil, see no evil". There is absolutely no reason for flaming.
 

theshadow27

macrumors newbie
Dec 10, 2009
7
0
Too bad there are still people who only judge things by their specs and the amount of free memory instead of the overall performance of the device.

I'm sorry, in case you missed it I've run performance tests with Safari, NetBeans, and VMWare fusion with all free vs. all inactive memory, and all three programs started and ran faster with free memory.

Since my post last year discussing a C program for clearing cached (inactive) memory, I've found a commercial product ( Activata iFreeMem ) that does the same thing with a GUI. If this was not an issue, and the "problem" was in our imagination, why would a company develop a product to provide a solution? Hint: it's not "because there's profit in people's ignorance."

I have been using the Activata product for a few months now and am very happy with it. Especially during the VMWare Fusion 3.1 beta, when they cached large (several gigs in some cases) performance metrics and debugging information, running a VM with 2GB of virtual memory would end up taking 6GB physical. If you quit VMWare, this became inactive memory, and opening a different VM would take 200-300 seconds. Freeing inactive ram via iFreeMem takes about 15 seconds, and launching a VM with all free memory takes about 25 seconds. The reasons for this are discussed elsewhere in this thread.
 

dyn

macrumors 68030
Aug 8, 2009
2,708
388
.nl
I'm sorry, in case you missed it I've run performance tests with Safari, NetBeans, and VMWare fusion with all free vs. all inactive memory, and all three programs started and ran faster with free memory.

Since my post last year discussing a C program for clearing cached (inactive) memory, I've found a commercial product ( Activata iFreeMem ) that does the same thing with a GUI. If this was not an issue, and the "problem" was in our imagination, why would a company develop a product to provide a solution? Hint: it's not "because there's profit in people's ignorance."
That's the most stupid question to ask since there an awful lot of applications out there that do nothing and yet you have to pay for it. A lot of tweaks you can do in the terminal are free but some people create an app and charge you for it. There are also quite a lot of products that simply resell an existing free product. This happened to OpenOffice.org. Also, there are quite a lot of pieces of malware that pretend to be malware removers and require you to pay for them. So why do companies create such products? Well, because they think they can make a profit or help people with it. So yes, there is profit in people's ignorance, quite a lot actually but it is not the only thing.

Again, as you've pointed out earlier the way OS X's memory management works is how it is supposed to work but it is flawed. As you've showed it is not always capable of freeing up the memory properly. And there is exactly the difference people need to see: "supposed to work" does not say anything about how well it works! You could also view it from another angle: by the way it is implemented it works how it's supposed to work but the implementation is wrong. It's expected behaviour but it is wrong behaviour.

I have been using the Activata product for a few months now and am very happy with it. Especially during the VMWare Fusion 3.1 beta, when they cached large (several gigs in some cases) performance metrics and debugging information, running a VM with 2GB of virtual memory would end up taking 6GB physical. If you quit VMWare, this became inactive memory, and opening a different VM would take 200-300 seconds. Freeing inactive ram via iFreeMem takes about 15 seconds, and launching a VM with all free memory takes about 25 seconds. The reasons for this are discussed elsewhere in this thread.
I don't notice anything of this. Fusion has been snappy since version 1 for me and it still is in version 3.1. Vm's open very quickly, resume and suspend quickly and the performance of the vm's doesn't degrade over time. Virtualisation apps are a bad example to use when you're talking about memory, especially VMware products. VMware not only uses RAM but it also uses the disk. VMware Fusion benefits from a lot of RAM but it also benefits from a fast disk like a ssd. Virtualisation applications also need to handle memory differently, it makes it a bit more complex. Using Fusion as an example is wrong for several reasons: it has had memory bugs in the past, it has had performance bugs related to things like virusscanners, the vm library, spotlight, etc. There are just too many variables with Fusion that could cause performance problems. You really need a testing procedure and run it several times.

Btw, the debugging option is in the beta, rc and final release of the product. You can disable it in the preferences. Once you disable it, it stays disabled no matter what version you're running (I've set this in 3.0 on this Mac and it stayed that way through the 3.1 beta cycle and the final version). When running into problems you can gather information and turn the debugging on.

On my Macs I haven't seen any application actually run faster with a lot or little to no free memory. They've always ran at the same speed. However I've noticed that starting up the application is a lot faster when they've already ran. VMware Fusion and OpenOffice.org seem to startup noticeably faster when you fire them up for the second time. It's possible that there are speed differences when running synthetic benchmarks but that's not really a good way of testing it because it is nowhere near reality. Judging by the fact there aren't posts all over the internet screaming OS X has a memory problem I don't think I'm the only one.

There are some things I don't see in this thread: memory management is different when using 64 bit which is common with the new Macs and with Snow Leopard. I don't see this taken into account. The same thing goes for memory leak bugs in the applications itself. Firefox, Safari and VMware Fusion are examples of applications that have or have had such bugs. Some applications can not release their memory properly due to some bug in their code. In this case it's obviously not an OS bug. Virtualisation handles memory a bit differently as well, I don't see this being mentioned in this thread either. This is especially important with VMware products since they use the disk for some memory management as well. Not everything gets pushed into the RAM. I also don't see anyone writing down a testing procedure nor do I see anyone running the test several times to check if the figures are coincidence or if they are not. This makes judging the results posted here really hard, you simply can not tell how you should read the figures and what they mean. To me they're just numbers. Just because I know OS X does have problems regarding memory management, I know people aren't making things up.
 

monkeyvn87

macrumors newbie
Jan 24, 2010
5
0
I have 4gb of ram in the latest (August 16th, 2007) MacBook Pro...

The memory management is actually quite horrible. At times I have 2gb of inactive memory... Even after I close down evertyhing but adium I still cannot get the space back.

So say I'm working rather quickly in Flash, Illustrator, and Dreamweaver while testing in Firefox and I need to start Parallels to load my bootcamp Partition of Windows with 512mb ram to test something in I.E... I have to restart, even if I close all the apps, it doesn't clear nearly enough memory...

This is my first time running OSX more than Windows in a development/design atmosphere... It manages memory worse than Windows when it comes to something like that. When 4gb and a 200gb hd aren't enough for proper multi tasking that I do on my windows machine at home without a hitch isn't enough... You're memory management is made for bloggers and students.

If anyone is wondering Vista flies on the MacBook Pro 17'. OSX is sluggish in comparison.

To clear memory, look up Dust on MacUpdate.com


To answer someone's question, "Do you think Apple would be that stupid?" Yes.


Your mom and your dad didn't teach you about modesty, did they?
 

Chase R

macrumors 65816
May 8, 2008
1,279
81
PDX
Ok, we all know that inactive memory is there for a reason. Apple says it is there so for an application to access, even though it isn't currently in use, before it has to go to the HDD and seek it. This is true, HOWEVER...

That doesn't dismiss the MANY, if not countless, claims that when a person's RAM is full of inactive memory, there system runs slower.

I've experienced it, as has lots of people I've talked to.

The process of allocating memory to "free" RAM opposed to replacing "inactive" RAM with another application is not the same. OS X slows down when dealing with large amounts of inactive memory. Anyone who argues that is either ignorant and unobservant or an Apple fanboy.

My system, as many OS X systems I've tested, operate much faster when there is an abundance of "free" memory opposed to a system that is stuffed full of "inactive" memory.
 

Stresspuppy

macrumors newbie
Nov 2, 2010
1
0
The reason that things are slow when the inactive memory is high is that when the system can't get memory, it starts swapping out to disk. HDD is EXTREMELY slow compared to RAM so you see a slow down. I have seen my 4gb Macbook Pro use 2-3 gb of swap space and I just have to shut everything down and reboot.

I tried the program mentioned above (iFreeMem) and it seems to do exactly what it says. However, what was swapped out to HDD seems to stay there so I have 550mb in swap but 2 gb of Free memory. So what the heck does it take to have stuff go back to memory and stop using the swap space (outside of rebooting)?
 

theshadow27

macrumors newbie
Dec 10, 2009
7
0
I tried the program mentioned above (iFreeMem) and it seems to do exactly what it says. However, what was swapped out to HDD seems to stay there so I have 550mb in swap but 2 gb of Free memory. So what the heck does it take to have stuff go back to memory and stop using the swap space (outside of rebooting)?

You can't get stuff from swap back into main memory without knowing "what it is", and presumably when you'd like to do so the application that knew "what it was" has long been closed, or discarded the variable reference without releasing it's memory. By the time it has been written to disk, the garbage collector has already decided that it can't be automatically released. (italics to clarify mind-blowingly vague pronoun usage, not to represent sarcasm)

Since memory in this state has no active owner, and no way of identifying where it came from or how important it is, it's sort of sucked into a black hole with no way out.

The only way to convince the system that you're not using any of the memory in swap (and in RAM) is to restart launchd (PID 1) - after which any allocated memory *not* allocated by the new launchd (before daemons load) is clearly not being used by anything. The only way I know of to restart PID 1 is by rebooting the machine.

There's also a second launchd (started by the PID 1 launchd) created when a user logs in. Many user space applications (mostly .app's) are children of this process. Logging out will kill this process and free up any memory being used by those processes, but I don't know enough about the launchctl mechanism to say whether an all-user logout in multiuser mode followed by a login will blank-slate the memory manager like dropping a run level in regular *nix.
 

mattski.au

macrumors newbie
Nov 11, 2008
2
0
6th year of this thread...

+1 that memory management could be better.

I work with audio and video programs and they definitely operate better with more free ram than inactive ram.

Currently I'm using a mac pro with 12gb ram and rendering some video with after effects. When free memory runs out, after effects rendering drops to 10% CPU usage as it spends all it's time waiting for pages to be swapped in and out of memory. With all my other apps quit, so there's free ram, the CPU usage is >400% and no surprises render times are about 40x faster.

Now, if I leave the computer to do nothing in my other apps, you would think they would eventually be paged to disk allowing after effects to run at it's full speed. This does not happen.

Perhaps it's the fault of the apps; perhaps it's the fault of the operating system. One thing is certain: having access to free ram allows programs to work faster than access to inactive ram.

On my home machine (with Xcode installed) I find that running 'purge' in a terminal window results in substantially better performance afterwards. This tool clears out inactive memory and effectively gives the memory system a full reset without having to reboot the whole computer.

Perhaps the purge tool should be a standard part of the os!?!
 

Chase R

macrumors 65816
May 8, 2008
1,279
81
PDX
I believe what is happening is that an app is chewing so much memory (this is the fault of the app developers), that it is paging out the memory that was once occupied by the system... Thus resulting in a slow laggy system when it has to page back in the memory from the HDD.

VLC does this with larger files (if you don't turn off "file memory mapping").

Vuze does this too... Horrible memory management.

I believe iVolume fixed this issue that it once had.

Transmission has become a little better with memory management, it is still catching quite a bit though.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.