Memory leak in the OS?

simX

Unofficial Mac Genius
OK, so I woke up today, and I heard the disk churning a lot, and so I turned on my computer -- a glance at the memory monitor showed that over half of my memory was active or wired, and that the rest of it was inactive, and not free (I have 896 MB of RAM, so that's a HUGE amount of active+wired memory). So I checked in top to see what might be using all that memory -- Norton, or something. Nothing out of the ordinary using so much RAM. So I quit all of my applications. Still my active+wired memory was over half of my total RAM. But something didn't seem right -- I went back to top to check on the memory usage, and it didn't seem like it added up. So I grabbed a calculator -- and added up all the columns of memory for RPRVT, RSHRD, and RSIZE in top. Now I knew that I would be adding up more memory than was actually being used, because RPRVT and RSHRD are included in RSIZE.

Well, so what did I find? Total, as reported by all the processes individually, including the kernel (process 0 -- I believe process 0 is the first process, so I did include every process), the memory that was being used was 197.9 MB. But total, the top command was reporting an obscene 532 MB active, 603.2 active+wired! I've included a screenshot of the terminal window (it has some text superimposed on it because I need to register Snapz Pro X, but you should be able to read it) so you guys can check my math. Remember, I added up all 3 columns of the top command, so the 200 MB is probably over the actual total by about 50-100 MB.

Clearly something is wrong here. Does anybody know what could be causing this? Every once in a while it seems like it does this to an extent, but it hasn't done it to this degree. As we speak, over half of my memory is being used as active or wired memory, but I can't figure out what!! And the numbers in top still do not add up.

Any information would be appreciated.

P.S. I have to run right now, but I know that the picture of the terminal window looks really gross. I'm going to put the picture on my iDisk when I get back -- my member name is "simX" -- just go to my public folder.
 

Attachments

  • grossmemorypicture.jpg
    grossmemorypicture.jpg
    67.6 KB · Views: 94
WTF is logfile rotation? Never heard that before.

Oh, by the way, when I logged out and logged back in again, the memory usage was back to normal. Still, something was wrong, and it sounds like a memory leak to me.
 
First off - are you running any of the following...

Seti@Home, Nav Beta, Adaptec drivers, etc. Basically, anything that acts as a kernel extension or runs as a background process?
 
I was running SETI@home and NAV beta at the time, but I closed SETI@home before adding up all the numbers, and it still didn't match up. However, the terminal "top" command lists EVERY SINGLE PROCESS, whether background or not. And NAV was listed in that picture, if you notice. So that wouldn't make a difference -- plus, NAV 8 public beta 2 fixed the problem with CPU hogging, and it still doesn't take up much memory, so that wouldn't be the problem.

I didn't notice the stuck process thing, but could that be taking up 400 MB of my memory? I kind of doubt it.
 
Unless you know what that stuck process was, I wouldn't doubt it. Could be a stuck kernel_tas, which is somewhere close to the memory that's unaccounted for (469M). I also noticed your kernel_tas process is much larger than mine (mine=357, yours=469), as is your kextd (mine=3.5 yours=5.1). Seems something modified your kernel adding 100+ MB). This all smells somewhat stinky to me, unless you know of some software that you installed that indeed modified the kernel. But only you could give insight to my observations as you are familiar with what has been modified on your system. The myriad of questions I would ask because I'm not familiar with your particular system would be wasteful. I suppose the situation has to rear it's ugly head again for any progress to be made into this problem.

As for a memory leak, I would think if some app or subsystem wasn't releasing it's occupied memory it would show in your top output as a larger than normal memory value and would grow as you used the offending app/subsys. Would it (memory) just disappear? That would be very odd indeed.

Good luck and let us know if you find something interesting.
 
i woke up and woke my imac up this morning and it too was amking all the processing noises you described and running very slowly in finder as if memory were being hogged. I didn't do all the tests you did, but it went away and went back to normal when i launched an app. I downloaded NAV beta but haven't touched it since it unpacked on the desktop. could this be our culprit? I also installed eddie's "classic?" and left it running in the doc. I think you also tried it didn't you? if so, this seems the more likely party.
 
a UNIX operating system logs quite a bit of system stuff. :) and it has schedules when to archive the logs and start new ones. or delete old ones. it also updates its databases (locate for example) in these schedules.
 
I REALLY doubt logfile rotation could take up 400 MB of memory. Wouldn't you agree? I would tend to think that the stuck process might be a more probable cause of this problem.
 
I figured out what was causing the problem.

I noticed tonight that the same thing happened -- almost all of my memory was being actively used, plus I was noticing MASSIVE pageouts about every 2 seconds or so. So with the knowledge that Ed had recently installed NAV beta and Classic?, I decided to check on these two. Obviously, Classic? was easier to check on, since it was just an open application, and I simply had to quit it. Lo and behold, when I quit it, almost HALF of all of my memory (about 450 megs) freed up immediately. That's one hell of a memory leak in Classic?. I'll have to notify the creator to fix this immediately -- of course, if he changes it to a menuling or a dockling, this will probably go away anyway.

I guess this thread comes to a close. Phew, it's not Apple's fault. :)
 
I'm so sorry for the panic and confussion.
I didn't notice the leak myself guess I have alot of free ram and drive space.
I had it running for about 5 hours with no trouble.

anyway please accept my appology.

I beleive the new version has fixed the leak.
you can download it an see what happens
http://www.versiontracker.com/redir.fcgi/kind=1&db=macosx&id=12796/Classiccheck012.sit

No gauruntee ymmv. hey it's free. but at least I got right on a fix :)

all feedback, comments and suggestions appreciated

efo@mac.com

Cheers
Eddie
 
Originally posted by simX
OK, so I woke up today, and I heard the disk churning a lot, and so I turned on my computer -- a glance at the memory monitor showed that over half of my memory was active or wired, and that the rest of it was inactive, and not free (I have 896 MB of RAM, so that's a HUGE amount of active+wired memory). So I checked in top to see what might be using all that memory -- Norton, or something. Nothing out of the ordinary using so much RAM. So I quit all of my applications. Still my active+wired memory was over half of my total RAM. But something didn't seem right -- I went back to top to check on the memory usage, and it didn't seem like it added up. So I grabbed a calculator -- and added up all the columns of memory for RPRVT, RSHRD, and RSIZE in top. Now I knew that I would be adding up more memory than was actually being used, because RPRVT and RSHRD are included in RSIZE.

Well, so what did I find? Total, as reported by all the processes individually, including the kernel (process 0 -- I believe process 0 is the first process, so I did include every process), the memory that was being used was 197.9 MB. But total, the top command was reporting an obscene 532 MB active, 603.2 active+wired! I've included a screenshot of the terminal window (it has some text superimposed on it because I need to register Snapz Pro X, but you should be able to read it) so you guys can check my math. Remember, I added up all 3 columns of the top command, so the 200 MB is probably over the actual total by about 50-100 MB.

Clearly something is wrong here. Does anybody know what could be causing this? Every once in a while it seems like it does this to an extent, but it hasn't done it to this degree. As we speak, over half of my memory is being used as active or wired memory, but I can't figure out what!! And the numbers in top still do not add up.

Any information would be appreciated.

P.S. I have to run right now, but I know that the picture of the terminal window looks really gross. I'm going to put the picture on my iDisk when I get back -- my member name is "simX" -- just go to my public folder.
Me too!!!, I have 1G RAM, but the system seems running under very low memory. No difference between 1G and 128 RAM when running 10.1. This must be the super bug in X.
 
Back
Top