On Apr 25, 2012, at 1:33 PM, Christopher Stone wrote:
On Apr 25, 2012, at 08:07, Alex Zavatone wrote:
What would rock, (I'll do it if I have time - ya, time, what is that) would be to have a way to close a Safari window when selecting it.
i used to end up with n+1 windows and up to 125 tabs, but on today's Safari, that's 4 GB of RAM used up, so sometimes, I just want to select a window from the menu and close it.
______________________________________________________________________
Hey Alex,
I've been known to have 300+ tabs open on occasion when I get lost in research. It gets messy, and I have to kill the Web Process to keep the memory use reasonable.
Ya, I remember when I could have 125 open on a 2 GB G5. Safari certainly isn't what it used to be. It's a horrible memory hog these days mostly due to JS leaks or sloppy item allocation/management.
I've had to often disable _javascript_ from the Safari Develop menu and switching to another browser (I require a location field and a search field) is too clunky for me to flow right now.
Often, I've had to disable everything, caches, images, style, _javascript_, just to get RAM back, BUT there also is another culprit.
Your Dashboard - Weather web apps in particular. Make sure to kill the dock and/or Dashboard clients. I did this after my quad core i7 Mac with 16 GB of RAM was getting pokey and BLAM, it zipped right up. There are lots of widgets that run web sessions and this contributes to the overhead - mostly I've seen these end up bogging down Safari's run event loop (if that's the right terminology) - or so I think.
So, recently, I've also started to use this terminal command: purge ram
Then wait while it tries to free up stuff.
But...
I've also resorted to pausing Safari at times and explicitly resuming it ala the Terminal and that works like a CHARM.
To pause:
Get Safari's PID#
Issue a kill to it with a SIGSTOP
To resume:
Issue a kill to it with a SIGCONT
Like so:
Pause:
kill -SIGSTOP 53944
Resume:
kill -SIGCONT 53944
One script that you can help on is a one that automatically pauses Safari (as above) when it moves to the background and resumes it when it moves to the front.
Just think of all that _javascript_ that's not operating.
I've seen Safari or maybe it's just webkit that's running that seems to have its main run event loop just bogged down waiting and waiting. Even if Safari is restricted to one core, it craters the performance of the whole machine.
So. You have multiple windows open, and you want to close one or more with ease.
Will these windows potentially have more than one tab in them?
Yes. Kill them. Kill them ALL!
Do you want to close the window with all tabs?
Yes. It should be murdered in cold blood.
Or do you want to be able to close tabs on an individual basis?
Just the window with all the tabs for the moment.
Either way it should be reasonably easy to do
I almost had time on Saturday, and registered as a Safari Developer (free), but was on a 13 hour work stretch. We could do it in either AppleScript or _javascript_. I'm just time restricted at the moment.