Re: detecting memory size?

2004-01-30 Thread Ketil Malde
Joachim Durchholz [EMAIL PROTECTED] writes: What I really want is the amount of memory my application can allocate and excercise lively without causing thrashing. On my Linux computer, that amounts more or less to the installed, physical RAM, minus a bit, so I'll settle for that. :-) An

Re: detecting memory size?

2004-01-30 Thread David Roundy
On Thu, Jan 29, 2004 at 01:13:28PM +0100, Ketil Malde wrote: My aplogies for being unclear! What I really want is the amount of memory my application can allocate and excercise lively without causing thrashing. On my Linux computer, that amounts more or less to the installed, physical RAM,

detecting memory size?

2004-01-29 Thread Ketil Malde
Hi, Is it possible to detect memory (i.e. RAM, not virtual memory) size from inside a Haskell program (so that I can keep my program from growing too large with consequent thrashing)? And if so, to what degree of portability? -kzm -- If I haven't seen further, it is by standing in the

Re: detecting memory size?

2004-01-29 Thread Ketil Malde
Glynn Clements [EMAIL PROTECTED] writes: What do you mean by memory size? How much RAM is installed in the system? The amount which the process is currently using? The amount which the OS might be willing to allocate to your process at any given point in time? Something else? My aplogies for

Re: detecting memory size?

2004-01-29 Thread Ketil Malde
Glynn Clements [EMAIL PROTECTED] writes: IIRC, getrlimit(RLIMIT_DATA) doesn't mean much on Linux, as it doesn't include memory which is added using mmap(..., MAP_ANON), which is used by glibc's malloc(). Also, getrlimit(RLIMIT_RSS) is probably more relevant for your purposes. I also got a

Re: detecting memory size?

2004-01-29 Thread Joachim Durchholz
Ketil Malde wrote: What I really want is the amount of memory my application can allocate and excercise lively without causing thrashing. On my Linux computer, that amounts more or less to the installed, physical RAM, minus a bit, so I'll settle for that. :-) An easier way would be to make this