Professional Web Applications Themes

memory leaking in 10.2.8? - Mac Programming

Hi groups, I have a question concerning the memory management in the OS X (10.2.8 to be exact). Either I don't understand the way it works or there is something like major memory leak in the version I referred to (I haven't noticed it with previous versions). The physical memory is divided into: wired, active, inactive, free. To my understanding they are being used as follows: wired: kernel itself, kernel modules (sorry... extesnsions!), device drivers etc. Shortly - things that has to remain in physical memory and can't be swapped out for several reasons. Timing for example. active: applications' code, ...

  1. #1

    Default memory leaking in 10.2.8?

    Hi groups,

    I have a question concerning the memory management in the OS X (10.2.8
    to be exact). Either I don't understand the way it works or there is
    something like major memory leak in the version I referred to (I haven't
    noticed it with previous versions).

    The physical memory is divided into: wired, active, inactive, free. To
    my understanding they are being used as follows:

    wired: kernel itself, kernel modules (sorry... extesnsions!), device
    drivers etc. Shortly - things that has to remain in physical memory and
    can't be swapped out for several reasons. Timing for example.

    active: applications' code, data, resources etc. Things that preferrably
    should stay in the physical mem, but can be swapped out if needed. I
    understand that this memory is the one that is actually "in use" by the
    user space code and data.

    inactive: code and data that has been in use but no longer is. It can be
    couinted almost as "free" in a sense that it can be cheaply recalled
    into use (active or even wired) but is kept with content "just in case"
    I suspect the disk caches are also in there?

    free: as the name says

    If there are no errors in the above (please point them out if any), then
    I would expect the following:

    wired: the allocation should be fairly stable over the time and should
    barely change unless I load/unload some extra modules, drivers, etc.

    active: should get allocated/freed while loading the apps, working on
    its data etc. This mean that whenever I quit all the apps, flush all the
    data etc., the amount of should be more or less the same as before
    loading the apps etc. In the end (when all the applications are quit),
    the amount of active memory should be similar to the amount allocated
    after the first login

    inactive: this I expect to grow over the time as due to the usage, more
    and more pages can have some previous states and be pushed into
    "incative" state

    free: I expect this to decrease over the time and replaced by the
    "inactive" memory.


    Now what happens is that

    wired: behaves as expected - I don't see any significant changes over
    the time - something like 55 to 59 MiB.

    inactive: bahaves as expected - The amount is getting bigger and bigger
    over the time.

    free: behaves as expected (?) getting less and less over the time

    BUT

    active: After a reboot and first login, I get something around 60MiB of
    "active" allocated. But no matter how hard I try to quit everything, I
    loaded, log-out/login etc. The amount of "active" grows bigger and
    bigger. Currently - with only one app loaded - I have already 170MiB
    allocated as "active". What is also happening is that (since there is
    almost no "free" mamory), every bigger allocation starts swapping the
    pages to virtual memory. It doesn't reclaim the "incative" or so. Just
    messes with the disk, while there is still some 250MiB "inactive"...



    Ufff.


    Now (if someone was patient enough to read all this) could someone
    explain me if there are errors in my understanding or in the memory
    handling???

    Patryk Guest

  2. #2

    Default Re: memory leaking in 10.2.8?

    In article <3fb2ab4a$inet.com.pl>,
    "Patryk 'Silver Dream !' ?ogiewa" <remove.it.pl> wrote:
     

    Inactive memory is not "no longer in use" as you wrote. It still
    contains valid data, but it has not been accessed recently. So if the
    level of activity decreases, it's perfectly normal for the amount of
    inactive memory to increase !

    Patrick
    --
    Patrick Stadelmann <ch>
    Patrick Guest

  3. #3

    Default Re: memory leaking in 10.2.8?

    Patryk 'Silver Dream !' Logiewa wrote:
     

    Take a look at
    http://www.macosxhints.com/article.php?story=20010613140025184

    Stefan

    Stefan Guest

  4. #4

    Default Re: memory leaking in 10.2.8?

    Patrick Stadelmann wrote:
     
    >
    >
    > Inactive memory is not "no longer in use" as you wrote. It still
    > contains valid data, but it has not been accessed recently. So if the
    > level of activity decreases, it's perfectly normal for the amount of
    > inactive memory to increase !
    >[/ref]

    Sure. I am not complaining about the "inactive" but the "active".

    Patryk Guest

  5. #5

    Default Re: memory leaking in 10.2.8?

    Stefan wrote:
     
    >
    >
    > Take a look at
    > http://www.macosxhints.com/article.php?story=20010613140025184
    >[/ref]
    I did. It more or less confirms what I have written. While I can
    understand that the amount of "inactive" is quite high and gets higher
    over the time for a reason (buffer cache for example). I simply can't
    understand why the "active" is increasing over the time, and not falling
    down with no applications loaded and no activity.

    Patryk Guest

  6. #6

    Default Re: memory leaking in 10.2.8?

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    At 2003-11-12T21:51:20Z, "Patryk 'Silver Dream !' Łogiewa" <.remove.it.pl> writes:
     

    Open a terminal window. Type "ps auxm | less" to get a listing of all
    processes running on your machine, sorted by descending order of memory
    usage. Without knowing what processes are actually using memory on your
    system, speculation is kind of pointless.
    - --
    Kirk Strauser
    The Strauser Group
    Open. Solutions. Simple.
    http://www.strausergroup.com/
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.3 (GNU/Linux)

    iD8DBQE/s8ji5sRg+Y0CpvERAjhiAJ4ztssM8endghDA20/qfTADo79gYwCgorU6
    L00EMJOIt+tP2dzvU+/a6us=
    =YAsC
    -----END PGP SIGNATURE-----
    Kirk Guest

  7. #7

    Default Re: memory leaking in 10.2.8?

    Kirk Strauser wrote: 
    >
    >
    > Open a terminal window. Type "ps auxm | less" to get a listing of all
    > processes running on your machine, sorted by descending order of memory
    > usage. Without knowing what processes are actually using memory on your
    > system, speculation is kind of pointless.[/ref]

    I was searching for this too. Here is the result: No application loaded
    except the terminal, two small add-ons (GeekTool and PTHClock but
    without them there is no change in the behaviour) and of course the
    system default processes, 172MiB "active" memory after a good period of
    no user activity, whereas after reboot it would be about 68 MiB with the
    same set of user processes

    [shanghai:~] silverdr% ps auxm
    USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
    silverdr 1879 0.0 5.3 652472 27600 ?? S 10:18PM 0:26.42
    /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder -psn_0_655361
    silverdr 1826 0.7 5.0 182436 26336 ?? Ss 8:38PM 1:28.79
    /System/Library/CoreServices/WindowServer console
    root 300 0.0 3.5 37388 18432 ?? Ss Thu04PM 0:05.50
    /System/Library/CoreServices/coreservicesd -preload AEServer
    silverdr 2016 1.3 3.1 630796 16292 ?? S 11:38PM 0:01.48
    /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_3276801
    silverdr 1827 0.0 1.9 112500 9804 ?? Ss 8:38PM 0:01.30
    /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
    console
    silverdr 1884 0.0 1.3 107456 6776 ?? S 10:18PM 0:07.31
    /Library/PreferencePanes/GeekTool.prefPane/Contents/Resources/GeekTool.app/Contents/MacOS/GeekTool
    -psn_0_1179649
    silverdr 1878 1.5 1.0 104832 5104 ?? S 10:18PM 0:29.93
    /System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer
    -psn_0_524289
    silverdr 165 0.0 0.9 49184 4800 ?? Ss Thu04PM 1:48.55
    /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Support/ATSSe
    silverdr 1877 0.0 0.9 108700 4468 ?? S 10:18PM 0:20.75
    /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock -psn_0_393217
    silverdr 1882 0.0 0.6 100672 2964 ?? S 10:18PM 0:00.74
    /Applications/tools/PTHClock/PTHClock.app/Contents/MacOS/PTHClock
    -psn_0_917505
    silverdr 1887 0.0 0.5 100084 2488 ?? S 10:18PM 0:07.54
    /System/Library/PreferencePanes/UniversalAccessPref.prefPane/Contents/Resources/UniversalAccess.app/Contents/MacOS/Un
    root 374 0.0 0.4 21868 2340 ?? S Thu04PM 0:03.30
    DirectoryService
    root 1798 0.0 0.4 19404 2136 ?? Ss 8:31PM 0:00.93
    AppleFileServer
    silverdr 1873 0.0 0.3 14980 1616 ?? Ss 10:18PM 0:01.75
    /System/Library/CoreServices/pbs
    root 107 0.0 0.2 16644 1196 ?? Ss Thu04PM 1:58.22
    configd
    root 846 0.0 0.2 80752 968 ?? S Thu10PM 0:01.03
    /usr/sbin/blued
    root 145 0.0 0.2 15432 944 ?? Ss Thu04PM 0:02.38
    /System/Library/CoreServices/SecurityServer -X
    root 1872 0.0 0.2 15220 924 ?? Ss 10:18PM 0:00.65
    /usr/sbin/lookupd
    silverdr 2018 0.0 0.2 5872 820 std S 11:38PM 0:00.09
    -tcsh (tcsh)
    root 268 0.0 0.2 14516 788 ?? Ss Thu04PM 0:00.68
    /usr/sbin/mDNSResponder
    root 1856 0.0 0.1 18192 592 ?? Ss 10:17PM 0:00.49
    slpd -f /etc/slpsa.conf
    root 2017 0.0 0.1 14048 572 std Ss 11:38PM 0:00.32
    login -pf silverdr
    root 198 0.0 0.1 14968 432 ?? Ss Thu04PM 0:04.28
    /sbin/autodiskmount -va
    root 318 0.0 0.1 15300 416 ?? Ss Thu04PM 0:02.96
    /usr/sbin/cupsd
    root 348 0.0 0.1 15008 376 ?? Ss Thu04PM 0:00.05
    /usr/sbin/automount -f -m /Network/Servers -fstab -m /automount -static
    root 51 0.0 0.1 15656 364 ?? Ss Thu04PM 0:03.05 kextd
    root 2030 0.0 0.1 1356 308 std R+ 11:38PM 0:00.00 ps
    -auxm
    root 280 0.0 0.1 1704 300 ?? Ss Thu04PM 0:03.62
    netinfod -s local
    silverdr 1886 0.0 0.0 1300 248 ?? Ss 10:18PM 0:00.28
    /usr/bin/tail -n 50 -F /var/log/system.log
    root 2 0.0 0.0 1844 168 ?? Ss Thu04PM 0:04.89
    /sbin/mach_init
    root 1 0.0 0.0 1308 132 ?? Ss Thu04PM 0:00.07
    /sbin/init
    root 254 0.0 0.0 1308 120 ?? Ss Thu04PM 0:00.40
    syslogd
    root 321 0.0 0.0 14124 116 ?? Ss Thu04PM 0:00.14 cron
    root 265 0.0 0.0 13584 88 ?? Ss Thu04PM 0:00.00
    /usr/libexec/crashreporterd
    root 314 0.0 0.0 1308 68 ?? Ss Thu04PM 0:00.00 inetd
    root 79 0.0 0.0 1316 60 ?? Ss Thu04PM 0:00.00
    dynamic_pager -H 40000000 -L 160000000 -S 80000000 -F
    /private/var/vm/swapfile
    root 75 0.0 0.0 1292 60 ?? Ss Thu04PM 0:06.66 update
    root 326 0.0 0.0 1296 40 ?? S Thu04PM 0:00.00
    nfsiod -n 4
    root 325 0.0 0.0 1296 40 ?? S Thu04PM 0:00.00
    nfsiod -n 4
    root 324 0.0 0.0 1296 40 ?? S Thu04PM 0:00.00
    nfsiod -n 4
    root 323 0.0 0.0 1296 40 ?? S Thu04PM 0:00.00
    nfsiod -n 4
    silverdr 2031 0.0 0.0 1136 4 std R+ 11:38PM 0:00.00 less

    Patryk Guest

Similar Threads

  1. Leaking memory in Perl XS Module
    By Shaun Clowes in forum PERL Modules
    Replies: 2
    Last Post: November 8th, 10:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139