Why can't Linux protect me from memory hogs? - Questions

This is a discussion on Why can't Linux protect me from memory hogs? - Questions ; Hey all, the problem is simple. I don't have an excessive amount of memory, but it is enough to run an X11 system and several applications comfortably. However, I tend to open too many browser windows or sometimes there is ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Why can't Linux protect me from memory hogs?

  1. Why can't Linux protect me from memory hogs?

    Hey all,

    the problem is simple. I don't have an excessive amount of memory, but
    it is enough to run an X11 system and several applications
    comfortably.

    However, I tend to open too many browser windows or sometimes there is
    a lot of data to process in a program, and then everything hangs and
    the hard-drive rattles with the usual noise giving me the impression
    of an infinite swap loop.

    Is there any way the kernel or a tool can prevent this?
    I want these memory hogs stopped or killed if necessary, but please
    let the other
    system run.

    Anton

  2. Re: Why can't Linux protect me from memory hogs?

    On Sun, 22 Feb 2004 10:24:50 -0800, Anton wrote:

    > Hey all,
    >
    > the problem is simple. I don't have an excessive amount of memory, but
    > it is enough to run an X11 system and several applications
    > comfortably.
    >
    > However, I tend to open too many browser windows or sometimes there is
    > a lot of data to process in a program, and then everything hangs and
    > the hard-drive rattles with the usual noise giving me the impression
    > of an infinite swap loop.
    >
    > Is there any way the kernel or a tool can prevent this?
    > I want these memory hogs stopped or killed if necessary, but please
    > let the other
    > system run.
    >
    > Anton


    Install more memory.

    A few questions for you: How much memory do you currently have, what
    window manager are you using, and how large is your swap partition?

    -Matthew

  3. Re: Why can't Linux protect me from memory hogs?

    Anton wrote:

    > Is there any way the kernel or a tool can prevent this?


    Most shells allow you to use `limit` to limit (for example) how much
    memory a process may allocate.

    Jacob
    --
    Warning: Dates in calendars are closer than they appear.

  4. Re: Why can't Linux protect me from memory hogs?

    gazelle-81@lycos.de (Anton) wrote in message news:<38a5446f.0402221024.1465f89@posting.google.com>...
    > Hey all,
    >
    > the problem is simple. I don't have an excessive amount of memory, but
    > it is enough to run an X11 system and several applications
    > comfortably.
    >
    > However, I tend to open too many browser windows or sometimes there is
    > a lot of data to process in a program, and then everything hangs and
    > the hard-drive rattles with the usual noise giving me the impression
    > of an infinite swap loop.
    >
    > Is there any way the kernel or a tool can prevent this?
    > I want these memory hogs stopped or killed if necessary, but please
    > let the other
    > system run.
    >
    > Anton


    Install more memory or just take it easy. You know your memory is
    little so why do you do all that? The computer can't do everything for
    ya.

    And what kinda low mem are we talking about exactly?

  5. Re: Why can't Linux protect me from memory hogs?

    I have 64MB RAM, the rest is broken. There is a 100MB swap partition.
    I'm running icewm to reduce the load.
    I don't really want to upgrade this laptop because it's old anyway,
    but I need it to work for my studies.
    It just worries me that a process out of bound hangs the system. The
    approach with limiting the resources is what I'm after and I'll have
    to look that up somewhere.
    I thought there must be an algorithm, maybe kernel patch, to reduce
    this eternal swapping.
    And weirdly enough browsers just go crazy once you've opened too many
    pages simultaneously, even if you close them later.

    Anton

  6. Re: Why can't Linux protect me from memory hogs?

    Anton wrote:
    : I have 64MB RAM, the rest is broken. There is a 100MB swap partition.
    : I'm running icewm to reduce the load.
    : I don't really want to upgrade this laptop because it's old anyway,
    : but I need it to work for my studies.
    [...snip]...
    : to look that up somewhere.
    : I thought there must be an algorithm, maybe kernel patch, to reduce
    : this eternal swapping.

    I don't know about this, but (having some similarly limited machines), I
    do have some suggestions:

    1. hdparm -- Make sure you are getting the most out of your
    drive. Swapping is bad enough without doing it in 16-bit w/o dma
    when you have 32 bit ide and dma availible... Figure out your
    best mode, and set it in a init script. I know from experience
    that this will help.

    2. Consider trying a 2.6 series kernel. I expect that the low
    kernel latency will return some responsivness even while you
    are swapping. Haven't gotten around to trying this yet. While
    you're building it you can, of course, strip out anything you
    don't need to reduce the kernels memory footprint.

    3. Low memory alternative apps. Try rxvt instead of xterm, etc.
    An extreme examples of this would be qemacs instead of GNU emacs,
    but I haven't gone that far yet. I'm a big fan of dillo for web
    browsing (but you will need to keep a full featured browser on
    the disk...). If your video subsystem used main RAM, go with
    fewer colors.

    Good luck,

    --
    -- David McKee
    -- dmckee@jlab.org


  7. Re: Why can't Linux protect me from memory hogs?

    rxvt is just as good a xterm for me and dillo is pretty cool.
    especially for just looking at local html files.
    does anyone have suggestions for nice low-mem...
    filebrowser or email programs?

    i am still convinced that there could be a way to optimise swapping on
    low mem systems. maybe kernel 2.6 is better at that...

    cheers for the suggestions,
    anton

    > 3. Low memory alternative apps. Try rxvt instead of xterm, etc.
    > An extreme examples of this would be qemacs instead of GNU emacs,
    > but I haven't gone that far yet. I'm a big fan of dillo for web
    > browsing (but you will need to keep a full featured browser on
    > the disk...). If your video subsystem used main RAM, go with
    > fewer colors.


  8. Re: Why can't Linux protect me from memory hogs?

    In comp.os.linux.misc Anton wrote:
    > Hey all,
    >
    > the problem is simple. I don't have an excessive amount of memory, but
    > it is enough to run an X11 system and several applications
    > comfortably.


    I've had similiar problems..

    > However, I tend to open too many browser windows or sometimes there is
    > a lot of data to process in a program, and then everything hangs and
    > the hard-drive rattles with the usual noise giving me the impression
    > of an infinite swap loop.


    For browsers, a big mistake people use is memory cache. (even if you have a
    lot of memory) You'll want to set that to zero, not 1M, not 5k, not even 1b
    :-)
    "memory cache" for copy where it was in the first place!
    Web page -> swap-out -----> swap-in -> disk-out

    Or worse, Linux will swap-out another application so the browser can store
    the page in "ram", which isn't really desirable.

    Setting cache to zero is almost always preferable anytime you have virtual
    memory, even if you had tons of memory to spare. (Linux would implement
    memory cache via disk buffer anyway) I wish browsers wouldn't even have a
    memory cache at all, it's silly in any modern v-ram setup with disk cache.

    > Is there any way the kernel or a tool can prevent this?
    > I want these memory hogs stopped or killed if necessary, but please
    > let the other
    > system run.


    You can have a look at ulimit for other problems.

    Jamie

  9. Re: Why can't Linux protect me from memory hogs?

    I ahve atoshiba 480cdt 266 64ram and 2guig HD
    I am runnign debian with icewmrox filer dillo and firebird browsers
    as wel las a few misc apps
    seems to do me fine



    On 25 Feb 2004 17:44:18 -0800, gazelle-81@lycos.de (Anton) wrote:

    >rxvt is just as good a xterm for me and dillo is pretty cool.
    >especially for just looking at local html files.
    >does anyone have suggestions for nice low-mem...
    >filebrowser or email programs?
    >
    >i am still convinced that there could be a way to optimise swapping on
    >low mem systems. maybe kernel 2.6 is better at that...
    >
    >cheers for the suggestions,
    >anton
    >
    >> 3. Low memory alternative apps. Try rxvt instead of xterm, etc.
    >> An extreme examples of this would be qemacs instead of GNU emacs,
    >> but I haven't gone that far yet. I'm a big fan of dillo for web
    >> browsing (but you will need to keep a full featured browser on
    >> the disk...). If your video subsystem used main RAM, go with
    >> fewer colors.



+ Reply to Thread