Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
setting memory quota for an app
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
disciplezero
n00b
n00b


Joined: 23 Mar 2003
Posts: 33

PostPosted: Sat Jun 07, 2003 1:53 am    Post subject: setting memory quota for an app Reply with quote

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
View user's profile Send private message
disciplezero
n00b
n00b


Joined: 23 Mar 2003
Posts: 33

PostPosted: Sat Jun 07, 2003 6:44 am    Post subject: Reply with quote

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
View user's profile Send private message
kopfarzt
Apprentice
Apprentice


Joined: 05 Apr 2003
Posts: 170
Location: Vienna, Austria

PostPosted: Sat Jun 07, 2003 7:57 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
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