|
|
#1 |
|
Triple-A Player
Join Date: Sep 2002
Posts: 95
|
fink/prebinding memory leak?
The past few times I've used fink, I noticed that the hard drive starts churning after the install is done. I checked out top/activity monitor, and it says that the update/fix prebinding process is going. I can live with that. However, once the install is complete, I end up with about 6mb of free RAM, as opposed to over 256MB free before. I know the amount of free ram isn't quite as important in OS X's memory management view, but when I add up the totals listed for all processes, it adds up to maybe 160MB, rather than 420MB of real memory usage. Yet free memory is still extremely small.
Is anyone else experiencing this? Does anyone know of a way to reclaim the memory without rebooting? AlBook G4 1.25ghz with 512mb of ram, 10.3.1 (7C107). Fink is at 0.62, package manager is 0.16.2. |
|
|
|
|
|
#2 |
|
MVP
Join Date: Mar 2002
Location: Elsewhere
Posts: 1,485
|
If you compile from source, fink installations do require a lot of memory, I'd agree with that from my experiences.
I used to want to reclaim that memory, too, but others here have explained to me that the OS is working correctly, keeping in memory things that it feels it might need again soon. If it needs that memory for something else, it will reclaim that memory itself and use it for that something else. That having been said, executing in Terminal: sudo du -sx will reclaim the free memory space. After a fink installation, it is unlikely that you'll be needing that memory information for gcc, etc, so reclaiming the memory is not going to circumvent your OS's efficiencies too much. In your day-to-day computing, reclaiming that memory might make your OS have to go get some things from the disk again that it would have been holding in RAM. |
|
|
|
|
|
#3 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
you should give that du a sufficient target; as it is stated above, the default dir to size is implicitly `.' and if your cwd doesn't contain a large number of files, it won't achieve the "sustained disk access" required to return inactive memory to the free list.
this should be an adequate 'inactive memory squisher' for any shell... Code:
sh -c 'du -sx /System/ &> /dev/null' |
|
|
|
|
|
#4 | |||||||||||||||||||
|
MVP
Join Date: Mar 2002
Location: Elsewhere
Posts: 1,485
|
I didn't know that. Thanks the information and for fixing my suggestion so that it would work as advertised. If an application really did have a memory leak, would this jar the memory loose. Or, being a memory leak, would the OS assume that this application still owned that memory? |
|||||||||||||||||||
|
|
|
|
|
#5 | |||||||||||||||||||
|
Triple-A Player
Join Date: Sep 2002
Posts: 95
|
This is what I was afraid of, because in the activity monitor, there is a large portion of allocated "active" ram, which isn't owned by any processes at all. Fortunately, using the command posted by macmath and merv, that ram came back instantly. Does anyone know of a way to configure fink to automatically run this after installing something? |
|||||||||||||||||||
|
|
|
|
|
#6 | |||||||||||||||||||
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
dubious. how do you know this or how did you determine this? |
|||||||||||||||||||
|
|
|
|
|
#7 | |||||||||||||||||||
|
MVP
Join Date: Mar 2002
Location: Elsewhere
Posts: 1,485
|
I'm not certain, but I think that the fact that it was released to you by mervTormel's command means that it was never locked up anyway and was available all along for release by the OS to another application that needed it. While (from our OS x, x<=9 days) it psychologically makes you and I feel better to see a lot of free RAM, it really isn't any better [as long as what is not really in use will be released when needed]. |
|||||||||||||||||||
|
|
|
|
|
#8 | |||||||||||||||||||
|
Triple-A Player
Join Date: Sep 2002
Posts: 95
|
I added up all of the ram listed (all processes) in the activity monitor, and compared it with the total. But that's probably flawed, now isn't it? ![]() I take it neither of you know how to modify fink to run du at the end? |
|||||||||||||||||||
|
|
|
|
|
#9 |
|
MVP
Join Date: Mar 2002
Location: Elsewhere
Posts: 1,485
|
I don't know how one would do that. I have a fragment of an idea surrounding writing scripts which would ask fink to do its thing and then call 'du', but to really make it robust would take *me* a lot of time. What if Fink did not have any base files to compile and install when you said 'fink selfupdate'? What if when you said 'fink update-all', the curl command failed and could not get something. Those kind of things.
You could just put an alias to mervTormel's command in your .cshrc or .bashrc file. Call it 'freemem' and just enter 'freemem' and hit return after each fink compile. |
|
|
|
|
|
#10 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
hmm, i don't think you want to modify the fink command; it wouldn't survive updates.
you might want to squish inactive memory when a certain highwater mark is reached. so, something in a cron job that checks the free-mem value and fires the du when a minimum is exceeded? for starters: Code:
$ vm_stat | grep free: Pages free: 138982. |
|
|
|
|
|
#11 | |||||||||||||||||||
|
Triple-A Player
Join Date: Sep 2002
Posts: 95
|
Thanks, I had thought of doing something like that earlier today, but completely forgot about it. It'd definitely be a lot better than using it just after fink. I'll post the script when I get it working, if any of you want it. |
|||||||||||||||||||
|
|
|
|
|
#12 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
i toyed with this long ago.
Code:
#!/bin/sh
# file: mflog - trigger memory flushing on hiwater breach
hiwater=12800 # 50MB at 4096 byte pages
# loop here
freemem=`/usr/bin/vm_stat | /usr/bin/grep free: | /usr/bin/sed 's/[^0-9]//g'`
[ ${freemem} -lt ${hiwater} ] && echo lt # this is where to implement the du
[ ${freemem} -gt ${hiwater} ] && echo gt
# sleep 45
# end loop
|
|
|
|
|
|
#13 |
|
Triple-A Player
Join Date: Sep 2002
Posts: 95
|
Thanks for the script merv, mine was basically the same. I used anacron to schedule it every 10 minutes (i think). But again, thanks to both of you for the help.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|