View previous topic :: View next topic |
Author |
Message |
disciplezero n00b
Joined: 23 Mar 2003 Posts: 33
|
Posted: Sat Jun 07, 2003 1:53 am Post subject: setting memory quota for an app |
|
|
Hey, I'm designing a piece of software, but I REALLY need to restrict its memory. Essentially I need to see how part of it happens to react to running out of memory. I've actually got is sucking out about as much memory as I can, and its still not having problems with allocating memory (which also makes me wonder if the library its dependant on is leaking since it keeps killing other apps when its under a high load).
All said and done, is there a way I can tell it to use, say 3 meg from outside. Perhaps something like electric fence, but outside? |
|
Back to top |
|
|
disciplezero n00b
Joined: 23 Mar 2003 Posts: 33
|
Posted: Sat Jun 07, 2003 6:44 am Post subject: |
|
|
Odd, now whenever I run the program, it gets killed but never gets an out of memory error. It appears that the kernel is killing it. It sucks out about 130 megs, other programs slowly die off, then it finally gets killed.
Any ideas |
|
Back to top |
|
|
kopfarzt Apprentice
Joined: 05 Apr 2003 Posts: 170 Location: Vienna, Austria
|
Posted: Sat Jun 07, 2003 7:57 am Post subject: |
|
|
To limit memory usage of your shell (which might be what you want), you can use ulimit (man bash). Another thing is the memory allocation. The kernel will give you as much memory as you want, as long as you don't actually use it (write to it). Only if you write, it will be allocated "physically". See the manpage of malloc.
kopfarzt |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|