Author Topic: fluffos 2.23 memory leak  (Read 7649 times)

Offline quixadhal

  • BFF
  • ***
  • Posts: 642
    • View Profile
    • WileyMUD
Re: fluffos 2.23 memory leak
« Reply #15 on: September 20, 2012, 10:43:12 pm »
Just for amusement:


USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
1002      4124  0.5  0.7  48916 30964 pts/3    S    Jul28 413:32 /home/bloodlines/bin/driver
1000      8337  0.0  0.4  56952 17336 pts/8    S+   Sep12   3:03 ./driver config
1000     28780  0.0  0.3  86956 15300 pts/6    S+   Sep09   9:23 ./driver dw.cfg
wiley    20972  0.1  0.3  84492 14996 ?        S    11:58   1:00 /home/wiley/bin/wileymud
www-data 27284  0.0  0.6 480036 26008 ?        Sl   Sep16   0:08 /usr/sbin/apache2 -k start
postgres  6115  0.0  0.2 102532  9768 ?        S    Aug28   1:36 /usr/lib/postgresql/9.1/bin/postgres


The "driver" processes are bloodlines, using the Dead Souls mudlib, and a stock Discworld and Skylib distribution, all connected to intermud with 1 player connected.  WileyMUD is a DikuMUD, also connected to intermud.  For comparison, I've included an apache web server and postgresql database server.

Note that the web server easily trumps everything else, despite this being a very low traffic site that likely gets about 200 hits a day, most of which are my home/status page refreshing itself.

Offline lonely

  • Acquaintance
  • *
  • Posts: 25
    • View Profile
Re: fluffos 2.23 memory leak
« Reply #16 on: September 21, 2012, 01:39:18 am »

top - 00:11:02 up 6 days, 13:47,  1 user,  load average: 0.18, 0.16, 0.16
Tasks: 272 total,   3 running, 269 sleeping,   0 stopped,   0 zombie
Cpu(s):  3.8%us,  1.6%sy,  0.0%ni, 94.4%id,  0.1%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:  16325596k total, 11981848k used,  4343748k free,  1018772k buffers
Swap: 18563064k total,        0k used, 18563064k free,  5494600k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                   
 9101 root      20   0 3139m 3.0g 2540 R 25.6 19.2   1655:39 driver   

top - 14:37:27 up 7 days,  4:13,  2 users,  load average: 0.22, 0.44, 0.42
Tasks: 276 total,   2 running, 274 sleeping,   0 stopped,   0 zombie
Cpu(s):  4.4%us,  2.0%sy,  0.0%ni, 93.2%id,  0.2%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:  16325596k total, 12594880k used,  3730716k free,  1029880k buffers
Swap: 18563064k total,        0k used, 18563064k free,  5726528k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                   
 9101 root      20   0 3444m 3.3g 2540 S 27.2 21.1   1876:54 driver 


Offline wodan

  • BFF
  • ***
  • Posts: 434
  • Drink and code, you know you want to!
    • View Profile
Re: fluffos 2.23 memory leak
« Reply #17 on: September 21, 2012, 05:29:17 am »
I assume that's with system malloc, and they still don't handle freeing memory with realloc properly? You don't really say what you are doing so far.

Offline lonely

  • Acquaintance
  • *
  • Posts: 25
    • View Profile
Re: fluffos 2.23 memory leak
« Reply #18 on: September 21, 2012, 06:45:19 am »
The memory usage of mudos has been increasing all the time and couldn't be free, sorry for my poor english
« Last Edit: September 21, 2012, 06:53:53 am by lonely »

Offline Camlorn

  • Friend
  • **
  • Posts: 76
    • View Profile
Re: fluffos 2.23 memory leak
« Reply #19 on: September 21, 2012, 11:27:15 am »
This may be an lpc issue.

    If you are running a mudlib that has no modifications, i.e. stock dead souls, then this probably shouldn't happen and we can blame it on the driver.  But if you modified something, and now you've got huge mappings or something, this could happen from lpc.

    For instance: adding keys to a mapping and not removing them when you're done, cloning a bunch of objects and never destroying them, etc.  If it's immediately after boot, it's possible you've got an object saved somewhere with a huge mapping probably of strings to strings.

    If the driver is leaking memory, enabling swapping won't fix it.  Try that and see if it gets better.  If lpc is the problem, enabling swapping may fix it, depending on whether or not the large objects are used frequently.  Swapping has performance penalties, do be aware of this.

    Isn't there a way to get FluffOS to dump statistics about objects in memory, or an efun to tell you how much memory an object is taking up?

    If all else fails, I suppose it's time to pull out valgrind, but valgrind will probably choke on FluffOS's memory allocation/reuse (I know it doesn't work on diku-derivatives, as all of those still use preallocated memory).

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1024
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: fluffos 2.23 memory leak
« Reply #20 on: September 24, 2012, 08:55:18 am »
Lonely, please post your driver build options.

Also, do you modify the driver source in any way at all before compiling? If so, what changes do you make?

-Crat