Is there a way to specify the maximum amount of memory an application is allowed to allocate... either programmatically or otherwise?
Is there a way to specify the maximum amount of memory an application is allowed to allocate... either programmatically or otherwise?
under linux you have the 'limit' command (per shell session as far as I remeber).
Don't know if you have something like that under windows.
Could you give example usage? When I type
> man limit
for example on my Linux I don't get anything... is it a different command?
Thanks.
so its not installed on your system.
Install it.
I am sure it will be in your package manager.
http://www.nada.kth.se/cgi-bin/man?p...s=1&ss=&M=&f=y
I think it should be "ulimit".
NAME
limit, ulimit, unlimit - set or get limitations on the sys-
tem resources available to the current shell and its descen-
dents
No the message is not too short.
"ulimit" is builtin into bash, so you don't need any packages to use it
magland (21st March 2007)
I stand corrected!
magland (21st March 2007)
Do you think I could use
void QThread::setStackSize ( uint stackSize )
to limit the available memory in a cross-platform application?
But I'm worried about using, say, stackSize = 10 MB for an unsigned integer...
What does "stackSize" precisely mean anyway?
P.S. -- Great site!
No, this will only limit the stack, whereas most of the memory is usually allocated on heap.
magland (23rd March 2007)
Well, just as it is named - the stack size.What does "stackSize" precisely mean anyway?
You might want to read about heap and stack.
http://en.wikipedia.org/wiki/Heap_%28programming%29
http://en.wikipedia.org/wiki/Stack_frame
magland (23rd March 2007)
Bookmarks