LaunchAgent to quit Safari

Discussion in 'Apple' started by Lewis, Jul 18, 2012.

  1. Lewis

    Lewis Guest

    I have the following launchagent:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>jte.safari</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/bin/osascript</string>
    <string>-e</string>
    <string>"tell application \"Safari\" to quit"</string>
    </array>
    <key>ServiceDescription</key>
    <string>Quit Safari</string>
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>6</integer>
    <key>Minute</key>
    <integer>15</integer>
    </dict>
    </dict>
    </plist>

    Which should quit Safari every morning at 6:15, only it doesn't. I
    checked today and the safari process was a month old.

    I have other LaunchAgents that work fine. It is loaded and listed as
    active in `launchctl list | grep jte.safari`

    Generally the machine is asleep at 6:15, but my understanding was that a
    timed event would fire the next time it could, not simply be skipped.

    Any ideas?

    --
    I WILL NOT DO THE DIRTY BIRD Bart chalkboard Ep. AABF08
    Lewis, Jul 18, 2012
    #1
    1. Advertising

  2. Lewis

    Thom Rosario Guest

    Lewis <> wrote:
    > I have the following launchagent:
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    > <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    > "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    > <plist version="1.0">
    > <dict>
    > <key>Label</key>
    > <string>jte.safari</string>
    > <key>ProgramArguments</key>
    > <array>
    > <string>/usr/bin/osascript</string>
    > <string>-e</string>
    > <string>"tell application \"Safari\" to quit"</string>
    > </array>
    > <key>ServiceDescription</key>
    > <string>Quit Safari</string>
    > <key>StartCalendarInterval</key>
    > <dict>
    > <key>Hour</key>
    > <integer>6</integer>
    > <key>Minute</key>
    > <integer>15</integer>
    > </dict>
    > </dict>
    > </plist>
    >
    > Which should quit Safari every morning at 6:15, only it doesn't. I
    > checked today and the safari process was a month old.
    >
    > I have other LaunchAgents that work fine. It is loaded and listed as
    > active in `launchctl list | grep jte.safari`
    >
    > Generally the machine is asleep at 6:15, but my understanding was that a
    > timed event would fire the next time it could, not simply be skipped.
    >
    > Any ideas?



    Perhaps try a shell command instead of an AppleScript?
    > killall Safari


    should do the trick
    Thom Rosario, Jul 22, 2012
    #2
    1. Advertising

  3. Lewis

    Lewis Guest

    In message <-september.org>
    Thom Rosario <> wrote:
    > Lewis <> wrote:
    >> I have the following launchagent:
    >>
    >> <?xml version="1.0" encoding="UTF-8"?>
    >> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    >> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    >> <plist version="1.0">
    >> <dict>
    >> <key>Label</key>
    >> <string>jte.safari</string>
    >> <key>ProgramArguments</key>
    >> <array>
    >> <string>/usr/bin/osascript</string>
    >> <string>-e</string>
    >> <string>"tell application \"Safari\" to quit"</string>
    >> </array>
    >> <key>ServiceDescription</key>
    >> <string>Quit Safari</string>
    >> <key>StartCalendarInterval</key>
    >> <dict>
    >> <key>Hour</key>
    >> <integer>6</integer>
    >> <key>Minute</key>
    >> <integer>15</integer>
    >> </dict>
    >> </dict>
    >> </plist>
    >>
    >> Which should quit Safari every morning at 6:15, only it doesn't. I
    >> checked today and the safari process was a month old.
    >>
    >> I have other LaunchAgents that work fine. It is loaded and listed as
    >> active in `launchctl list | grep jte.safari`
    >>
    >> Generally the machine is asleep at 6:15, but my understanding was that a
    >> timed event would fire the next time it could, not simply be skipped.
    >>
    >> Any ideas?



    > Perhaps try a shell command instead of an AppleScript?
    >> killall Safari


    The point is to have this fire at 06:15 every single day, or as soon as
    the machine wakes up in the morning if it's after 06:15.

    The osascript command works, it is the LaunchAgent that doesn't seem to work.

    --
    THE PRESIDENT DID IT IS NOT AN EXCUSE Bart chalkboard Ep. AABF05
    Lewis, Jul 23, 2012
    #3
  4. Lewis

    Lewis Guest

    In message <>
    Jolly Roger <> wrote:
    > In article <>,
    > Lewis <> wrote:


    >> I have the following launchagent:
    >>
    >> <?xml version="1.0" encoding="UTF-8"?>
    >> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    >> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    >> <plist version="1.0">
    >> <dict>
    >> <key>Label</key>
    >> <string>jte.safari</string>
    >> <key>ProgramArguments</key>
    >> <array>
    >> <string>/usr/bin/osascript</string>
    >> <string>-e</string>
    >> <string>"tell application \"Safari\" to quit"</string>
    >> </array>
    >> <key>ServiceDescription</key>
    >> <string>Quit Safari</string>
    >> <key>StartCalendarInterval</key>
    >> <dict>
    >> <key>Hour</key>
    >> <integer>6</integer>
    >> <key>Minute</key>
    >> <integer>15</integer>
    >> </dict>
    >> </dict>
    >> </plist>
    >>
    >> Which should quit Safari every morning at 6:15, only it doesn't. I
    >> checked today and the safari process was a month old.
    >>
    >> I have other LaunchAgents that work fine. It is loaded and listed as
    >> active in `launchctl list | grep jte.safari`
    >>
    >> Generally the machine is asleep at 6:15, but my understanding was that a
    >> timed event would fire the next time it could, not simply be skipped.
    >>
    >> Any ideas?


    > Have you examined the system log to see if there are entries around the
    > time the event is supposed to happen?


    Yes, and there's nothing at all in them. The user is not an admin user, so he doesn't have access to all the loggin, so I will try and reload the LaunchAgent and doublecheck if the admin account sees anything in the logs.

    --
    When we woke up that morning we had no way of knowing that in a matter
    of hours we'd changed the way we were going. Where would I be now? Where
    would I be now if we'd never met? Would I be singing this song to
    someone else instead?
    Lewis, Jul 23, 2012
    #4
  5. Lewis

    Lewis Guest

    In message <>
    Jolly Roger <> wrote:
    > BTW, if Safari is not running, your script will cause it to launch. ; )


    Launch and then quit. Small price to pay for getting it to quit on a
    regular basis. I have never seen it take multiple GB of real memory on
    my machines, but on this one last time I checked it was using 10.4GB of
    Real Memory for something like 8 tabs.

    --
    Just give us a kiss to celebrate here, today.
    Lewis, Jul 23, 2012
    #5
  6. Lewis

    Lewis Guest

    In message <>
    Paul Sture <> wrote:
    > Why not put the whole call to osascript into a script and call that?


    I will probably do that.

    --
    Mirrors contain infinity. Infinity contains more things than you think.
    Everything, for a start. Including hunger. Because there's a million
    billion images, but only one soul to go around. --Witches Abroad
    Lewis, Jul 23, 2012
    #6
  7. Lewis

    John Drako Guest

    On Wed, 18 Jul 2012 02:49:25 -0400, Lewis wrote
    (in article <>):

    > I have the following launchagent:
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    > <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    > "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    > <plist version="1.0">
    > <dict>
    > <key>Label</key>
    > <string>jte.safari</string>
    > <key>ProgramArguments</key>
    > <array>
    > <string>/usr/bin/osascript</string>
    > <string>-e</string>
    > <string>"tell application \"Safari\" to quit"</string>
    > </array>
    > <key>ServiceDescription</key>
    > <string>Quit Safari</string>
    > <key>StartCalendarInterval</key>
    > <dict>
    > <key>Hour</key>
    > <integer>6</integer>
    > <key>Minute</key>
    > <integer>15</integer>
    > </dict>
    > </dict>
    > </plist>
    >
    > Which should quit Safari every morning at 6:15, only it doesn't. I
    > checked today and the safari process was a month old.
    >
    > I have other LaunchAgents that work fine. It is loaded and listed as
    > active in `launchctl list | grep jte.safari`
    >
    > Generally the machine is asleep at 6:15, but my understanding was that a
    > timed event would fire the next time it could, not simply be skipped.
    >
    > Any ideas?


    You're missing the username argument:

    right before the last </dict> add:

    <key>UserName</key>
    <string>your short user name here</string>
    </dict>
    </plist>
    John Drako, Jul 23, 2012
    #7
  8. Lewis

    Lewis Guest

    In message <Z0gPr.9781$%>
    John Drako <> wrote:
    > On Wed, 18 Jul 2012 02:49:25 -0400, Lewis wrote
    > (in article <>):


    >> I have the following launchagent:
    >>
    >> <?xml version="1.0" encoding="UTF-8"?>
    >> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    >> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    >> <plist version="1.0">
    >> <dict>
    >> <key>Label</key>
    >> <string>jte.safari</string>
    >> <key>ProgramArguments</key>
    >> <array>
    >> <string>/usr/bin/osascript</string>
    >> <string>-e</string>
    >> <string>"tell application \"Safari\" to quit"</string>
    >> </array>
    >> <key>ServiceDescription</key>
    >> <string>Quit Safari</string>
    >> <key>StartCalendarInterval</key>
    >> <dict>
    >> <key>Hour</key>
    >> <integer>6</integer>
    >> <key>Minute</key>
    >> <integer>15</integer>
    >> </dict>
    >> </dict>
    >> </plist>
    >>
    >> Which should quit Safari every morning at 6:15, only it doesn't. I
    >> checked today and the safari process was a month old.
    >>
    >> I have other LaunchAgents that work fine. It is loaded and listed as
    >> active in `launchctl list | grep jte.safari`
    >>
    >> Generally the machine is asleep at 6:15, but my understanding was that a
    >> timed event would fire the next time it could, not simply be skipped.
    >>
    >> Any ideas?


    > You're missing the username argument:


    > right before the last </dict> add:


    > <key>UserName</key>
    > <string>your short user name here</string>
    > </dict>
    > </plist>


    I have well more than a dozen ~/Library/LaunchAgents and not one has a
    Username key. As I understand it, the username is only used if you want
    a task to run from /Library as a specific user instead of either root
    (LaunchDaemons) or the user logging in (LaunchAgents).

    --
    what was supposed to be so special about a full moon? It was only a big
    circle of light. And the dark of the moon was only darkness. But
    half-way between the two, when the moon was between the worlds of light
    and dark, when even the moon lived on the edge... maybe then a witch
    could believe in the moon. --Witches Abroad
    Lewis, Jul 24, 2012
    #8
  9. Lewis

    John Drako Guest

    On Mon, 23 Jul 2012 22:47:26 -0400, Lewis wrote
    (in article <>):

    > In message <Z0gPr.9781$%>
    > John Drako <> wrote:
    >> On Wed, 18 Jul 2012 02:49:25 -0400, Lewis wrote
    >> (in article <>):

    >
    >>> I have the following launchagent:
    >>>
    >>> <?xml version="1.0" encoding="UTF-8"?>
    >>> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    >>> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    >>> <plist version="1.0">
    >>> <dict>
    >>> <key>Label</key>
    >>> <string>jte.safari</string>
    >>> <key>ProgramArguments</key>
    >>> <array>
    >>> <string>/usr/bin/osascript</string>
    >>> <string>-e</string>
    >>> <string>"tell application \"Safari\" to quit"</string>
    >>> </array>
    >>> <key>ServiceDescription</key>
    >>> <string>Quit Safari</string>
    >>> <key>StartCalendarInterval</key>
    >>> <dict>
    >>> <key>Hour</key>
    >>> <integer>6</integer>
    >>> <key>Minute</key>
    >>> <integer>15</integer>
    >>> </dict>
    >>> </dict>
    >>> </plist>
    >>>
    >>> Which should quit Safari every morning at 6:15, only it doesn't. I
    >>> checked today and the safari process was a month old.
    >>>
    >>> I have other LaunchAgents that work fine. It is loaded and listed as
    >>> active in `launchctl list | grep jte.safari`
    >>>
    >>> Generally the machine is asleep at 6:15, but my understanding was that a
    >>> timed event would fire the next time it could, not simply be skipped.
    >>>
    >>> Any ideas?

    >
    >> You're missing the username argument:

    >
    >> right before the last </dict> add:

    >
    >> <key>UserName</key>
    >> <string>your short user name here</string>
    >> </dict>
    >> </plist>

    >
    > I have well more than a dozen ~/Library/LaunchAgents and not one has a
    > Username key. As I understand it, the username is only used if you want
    > a task to run from /Library as a specific user instead of either root
    > (LaunchDaemons) or the user logging in (LaunchAgents).


    It helped in the past for me. Give it a try before dismissing it.
    John Drako, Jul 24, 2012
    #9
  10. In article <t8pPr.94645$>,
    John Drako <> wrote:

    > On Mon, 23 Jul 2012 22:47:26 -0400, Lewis wrote
    > (in article <>):
    >
    > > In message <Z0gPr.9781$%>
    > > John Drako <> wrote:
    > >> On Wed, 18 Jul 2012 02:49:25 -0400, Lewis wrote
    > >> (in article <>):

    > >
    > >>> I have the following launchagent:
    > >>>
    > >>> <?xml version="1.0" encoding="UTF-8"?>
    > >>> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    > >>> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    > >>> <plist version="1.0">
    > >>> <dict>
    > >>> <key>Label</key>
    > >>> <string>jte.safari</string>
    > >>> <key>ProgramArguments</key>
    > >>> <array>
    > >>> <string>/usr/bin/osascript</string>
    > >>> <string>-e</string>
    > >>> <string>"tell application \"Safari\" to quit"</string>
    > >>> </array>
    > >>> <key>ServiceDescription</key>
    > >>> <string>Quit Safari</string>
    > >>> <key>StartCalendarInterval</key>
    > >>> <dict>
    > >>> <key>Hour</key>
    > >>> <integer>6</integer>
    > >>> <key>Minute</key>
    > >>> <integer>15</integer>
    > >>> </dict>
    > >>> </dict>
    > >>> </plist>
    > >>>
    > >>> Which should quit Safari every morning at 6:15, only it doesn't. I
    > >>> checked today and the safari process was a month old.
    > >>>
    > >>> I have other LaunchAgents that work fine. It is loaded and listed as
    > >>> active in `launchctl list | grep jte.safari`
    > >>>
    > >>> Generally the machine is asleep at 6:15, but my understanding was that a
    > >>> timed event would fire the next time it could, not simply be skipped.
    > >>>
    > >>> Any ideas?

    > >
    > >> You're missing the username argument:

    > >
    > >> right before the last </dict> add:

    > >
    > >> <key>UserName</key>
    > >> <string>your short user name here</string>
    > >> </dict>
    > >> </plist>

    > >
    > > I have well more than a dozen ~/Library/LaunchAgents and not one has a
    > > Username key. As I understand it, the username is only used if you want
    > > a task to run from /Library as a specific user instead of either root
    > > (LaunchDaemons) or the user logging in (LaunchAgents).

    >
    > It helped in the past for me. Give it a try before dismissing it.


    While it obviously can't hurt to try, I think he's right. UserName
    isn't needed in personal LaunchAgent files, only in the system-wide
    file. I've never had to add that in any of my LaunchAgent files.

    In fact, I'd go so far as to say that putting it in personal files would
    be *wrong*. User A shouldn't be able to run programs as User B, so what
    would be the point if the only name you can put there is the one that it
    knows it has to run the program as.

    I suspect the problem is the quoting. Try changing:

    <string>"tell application \"Safari\" to quit"</string>

    to:

    <string>tell application "Safari" to quit</string>

    Quotes around a string are only needed for the shell, but LaunchDaemon
    is running the program directly, not going through a shell. And the
    separate <string>...</string> elements in the array already indicate
    that it's a single string argument.

    --
    Barry Margolin,
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    Barry Margolin, Jul 24, 2012
    #10
  11. Lewis

    Lewis Guest

    In message <-september.org>
    Barry Margolin <> wrote:
    > In article <t8pPr.94645$>,
    > John Drako <> wrote:


    >> On Mon, 23 Jul 2012 22:47:26 -0400, Lewis wrote
    >> (in article <>):
    >>
    >> > In message <Z0gPr.9781$%>
    >> > John Drako <> wrote:
    >> >> On Wed, 18 Jul 2012 02:49:25 -0400, Lewis wrote
    >> >> (in article <>):
    >> >
    >> >>> I have the following launchagent:
    >> >>>
    >> >>> <?xml version="1.0" encoding="UTF-8"?>
    >> >>> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    >> >>> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    >> >>> <plist version="1.0">
    >> >>> <dict>
    >> >>> <key>Label</key>
    >> >>> <string>jte.safari</string>
    >> >>> <key>ProgramArguments</key>
    >> >>> <array>
    >> >>> <string>/usr/bin/osascript</string>
    >> >>> <string>-e</string>
    >> >>> <string>"tell application \"Safari\" to quit"</string>
    >> >>> </array>
    >> >>> <key>ServiceDescription</key>
    >> >>> <string>Quit Safari</string>
    >> >>> <key>StartCalendarInterval</key>
    >> >>> <dict>
    >> >>> <key>Hour</key>
    >> >>> <integer>6</integer>
    >> >>> <key>Minute</key>
    >> >>> <integer>15</integer>
    >> >>> </dict>
    >> >>> </dict>
    >> >>> </plist>
    >> >>>
    >> >>> Which should quit Safari every morning at 6:15, only it doesn't. I
    >> >>> checked today and the safari process was a month old.
    >> >>>
    >> >>> I have other LaunchAgents that work fine. It is loaded and listed as
    >> >>> active in `launchctl list | grep jte.safari`
    >> >>>
    >> >>> Generally the machine is asleep at 6:15, but my understanding was that a
    >> >>> timed event would fire the next time it could, not simply be skipped.
    >> >>>
    >> >>> Any ideas?
    >> >
    >> >> You're missing the username argument:
    >> >
    >> >> right before the last </dict> add:
    >> >
    >> >> <key>UserName</key>
    >> >> <string>your short user name here</string>
    >> >> </dict>
    >> >> </plist>
    >> >
    >> > I have well more than a dozen ~/Library/LaunchAgents and not one has a
    >> > Username key. As I understand it, the username is only used if you want
    >> > a task to run from /Library as a specific user instead of either root
    >> > (LaunchDaemons) or the user logging in (LaunchAgents).

    >>
    >> It helped in the past for me. Give it a try before dismissing it.


    > While it obviously can't hurt to try, I think he's right. UserName
    > isn't needed in personal LaunchAgent files, only in the system-wide
    > file. I've never had to add that in any of my LaunchAgent files.


    Checking the man page for the launchd.plist it says:

    UserName <string>
    This optional key specifies the user to run the job as. This key is only
    applicable when launchd is running as root.

    > <string>"tell application \"Safari\" to quit"</string>


    > to:


    > <string>tell application "Safari" to quit</string>


    > Quotes around a string are only needed for the shell, but LaunchDaemon
    > is running the program directly, not going through a shell. And the
    > separate <string>...</string> elements in the array already indicate
    > that it's a single string argument.


    I will also try that. I should have my hands on that machine again here
    in the next couple of days.

    --
    'Pardon me for living, I'm sure.' NO-ONE GETS PARDONED FOR LIVING.
    Lewis, Jul 24, 2012
    #11
  12. Lewis

    Lewis Guest

    In message <>
    Lewis <> wrote:
    > I have the following launchagent:


    I ended up changing the Program arguments to call a script

    ---begin---
    #!/bin/bash

    SAFARI=`ps -U"$USER" -co command | grep "\bSafari\b"`

    if [ "$SAFARI" ]; then
       /usr/bin/osascript -e "tell application \"Safari\" to quit"
    fi

    /usr/bin/osascript -e "tell application \"Safari\" to activate"

    ---EOF---

    This appears to have worked this morning.

    Of course, as far as I can tell, this is not at all necessary on 10.8 as
    it seemed to be on this machine under 10.7, so it may turn out to be a
    cow's opinion.


    I suspect I could make this generic and call it with an app name like this:

    #!/bin/bash

    QUITIT=$1
    if [ "$QUITIT" ]; then
    QUITME=`ps -U"$USER" -co command | grep "\b${QUITIT}\b"`

    if [ "$QUITME" ]; then
        /usr/bin/osascript -e "tell application \"${QUITIT}\" to quit"
    fi

    /usr/bin/osascript -e "tell application \"${QUITIT}\" to activate"
    else
    echo "Requires basename of application to quit"
    fi

    But I have not tested that, and the osascrpt line probably needs more escaping.


    --
    Vi Veri Veniversum Vivus Vici
    Lewis, Aug 6, 2012
    #12
  13. Lewis

    Jeff N Guest

    On 2012-08-06 19:46:18 +0000, Lewis said:

    > In message <>
    > Lewis <> wrote:
    >> I have the following launchagent:

    >
    > I ended up changing the Program arguments to call a script
    >
    > <snip/>
    >
    > This appears to have worked this morning.
    >
    > Of course, as far as I can tell, this is not at all necessary on 10.8 as
    > it seemed to be on this machine under 10.7, so it may turn out to be a
    > cow's opinion


    Being overly concerned about the RAM usage of Safari is pointless
    anyway. If you need that memory for something else, the system will
    send Safari a memory warning message and it will drop some of its
    memory on its own. Otherwise, there's no harm in it having the memory
    allocated, it'll use the RAM for caching which is a huge performance
    boost. In Safari's case it isn't bloat, but actual resource
    utilization. RAM that is not being used is not helping your system
    performance.

    --
    Software Engineer
    (My posts reflect my opinions, not my employer's)
    Jeff N, Aug 7, 2012
    #13
  14. Lewis

    Lewis Guest

    In message <2012080623552980394-jeffnospam@jnadeaucom>
    Jeff N <> wrote:
    > On 2012-08-06 19:46:18 +0000, Lewis said:


    >> In message <>
    >> Lewis <> wrote:
    >>> I have the following launchagent:

    >>
    >> I ended up changing the Program arguments to call a script
    >>
    >> <snip/>
    >>
    >> This appears to have worked this morning.
    >>
    >> Of course, as far as I can tell, this is not at all necessary on 10.8 as
    >> it seemed to be on this machine under 10.7, so it may turn out to be a
    >> cow's opinion


    > Being overly concerned about the RAM usage of Safari is pointless
    > anyway.


    When Safari is using 10GB of REAL memory, that is a concern. When the
    entire computer takes minutes to recognize a key-press or a mouse click,
    that is a concern.

    --
    "Queen Isabella and King Ferdinand kicked 200,000 Jews out of Spain, one
    of the first acts of the Spanish Inquisition, which no one ever expects
    " -- John Carroll's 21st Annual Xmas Quiz answers
    Lewis, Aug 7, 2012
    #14
  15. Lewis

    nospam Guest

    In article <2012080623552980394-jeffnospam@jnadeaucom>, Jeff N
    <> wrote:

    > Being overly concerned about the RAM usage of Safari is pointless
    > anyway.


    definitely not.

    > If you need that memory for something else, the system will
    > send Safari a memory warning message and it will drop some of its
    > memory on its own.


    no it won't. safari has a huge memory leak and its memory footprint
    keeps growing and growing.

    you may be thinking of ios, where it can get a low memory message and
    then quit.

    > Otherwise, there's no harm in it having the memory
    > allocated, it'll use the RAM for caching which is a huge performance
    > boost.


    no it won't. as safari's memory footprint grows, the system creates
    more virtual memory swap files and the overall system gets slower due
    to thrashing.

    > In Safari's case it isn't bloat, but actual resource
    > utilization. RAM that is not being used is not helping your system
    > performance.


    exactly why you need to quit safari every so often, so the system can
    reclaim that memory and put it to better use.
    nospam, Aug 7, 2012
    #15
  16. Lewis

    Jeff N Guest

    You are right in that OS X does not send the
    applicationDidReceiveMemoryWarning selector, but the thing that I *was*
    thinking of probably does not apply to Safari, in retrospect... WebKit
    is written in C++ and the bulk of the memory managment is almost
    certainly in that language.

    --
    Software Engineer
    (My posts reflect my opinions, not my employer's)
    Jeff N, Aug 8, 2012
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. Uh Clem
    Replies:
    12
    Views:
    360
    void * clvrmnky()
    Apr 7, 2006
  2. Davoud
    Replies:
    28
    Views:
    721
    Michelle Steiner
    Aug 12, 2007
  3. Lewis

    LaunchAgent to quit Safari

    Lewis, Jul 18, 2012, in forum: Apple
    Replies:
    0
    Views:
    199
    Lewis
    Jul 18, 2012
  4. Dav
    Replies:
    1
    Views:
    194
  5. j Burns
    Replies:
    13
    Views:
    369
    Lewis
    Feb 5, 2013
Loading...

Share This Page