+RTS -M800M

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

+RTS -M800M

Joel Reymont
Folks,

I'm trying to restrict GHC to 800Mb of heap at runtime by passing in  
+RTS -M800M, the machine has 1Gb of memory and top shows free  
physical memory dropping below 175Mb. I suppose I'm missing something  
obvious or paying attention to the wrong statistics, Unix has a good  
VM manager after all. Are my runtime options correct, though?

        Thanks, Joel

--
http://wagerlabs.com/





_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

RE: +RTS -M800M

Simon Marlow
On 16 December 2005 10:05, Joel Reymont wrote:

> I'm trying to restrict GHC to 800Mb of heap at runtime by passing in
> +RTS -M800M, the machine has 1Gb of memory and top shows free
> physical memory dropping below 175Mb. I suppose I'm missing something
> obvious or paying attention to the wrong statistics, Unix has a good
> VM manager after all. Are my runtime options correct, though?

-M800m should do more or less the right thing, but it is possible for
GHC to exceed this figure by a small percentage.  Rather than
considering the "worst case" requirements for the next GC, GHC uses a
more "average case" estimate, which sometimes ends up being wrong, but
in most cases results in better utilisation of the available memory.

Cheers,
        Simon
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: +RTS -M800M

Ketil Malde-2
"Simon Marlow" <[hidden email]> writes:

> On 16 December 2005 10:05, Joel Reymont wrote:
>
>> I'm trying to restrict GHC to 800Mb of heap at runtime by passing in
>> +RTS -M800M, the machine has 1Gb of memory and top shows free
>> physical memory dropping below 175Mb.

> -M800m should do more or less the right thing, but it is possible for
> GHC to exceed this figure by a small percentage.  

Is there any chance there is a bug in recent GHCs (or perhaps Linux?)
affecting this?  I'm fairly sure I've lately seen Haskell programs
consuming significantly larger amounts of memory than they should be
allowed to, and I can try to isolate a test case if it is of
interest.

-k
--
If I haven't seen further, it is by standing in the footprints of giants

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: +RTS -M800M

Tomasz Zielonka
On Sat, Dec 17, 2005 at 10:56:58PM +0100, Ketil Malde wrote:
> Is there any chance there is a bug in recent GHCs (or perhaps Linux?)
> affecting this?  I'm fairly sure I've lately seen Haskell programs
> consuming significantly larger amounts of memory than they should be
> allowed to, and I can try to isolate a test case if it is of
> interest.

It can surely happen when you interface to foreign libraries that
allocate memory on their own - outside of GHC's heap.

Best regards
Tomasz

--
I am searching for a programmer who is good at least in some of
[Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

RE: +RTS -M800M

Simon Peyton Jones
In reply to this post by Joel Reymont

| Is there any chance there is a bug in recent GHCs (or perhaps Linux?)
| affecting this?  I'm fairly sure I've lately seen Haskell programs
| consuming significantly larger amounts of memory than they should be
| allowed to, and I can try to isolate a test case if it is of
| interest.

New bugs are always possible!  And in the last few months, Simon has
been doing fairly major surgery on parts of the runtime system, as part
of getting multiprocessor-GHC to play nicely.  

So if you can find a test case where GHC is generating code that uses a
lot more memory than it used it, it would be very valuable to us.
Thanks!

Simon
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

RE: +RTS -M800M

Simon Marlow
In reply to this post by Joel Reymont
On 17 December 2005 21:57, Ketil Malde wrote:

> "Simon Marlow" <[hidden email]> writes:
>
>> On 16 December 2005 10:05, Joel Reymont wrote:
>>
>>> I'm trying to restrict GHC to 800Mb of heap at runtime by passing in
>>> +RTS -M800M, the machine has 1Gb of memory and top shows free
>>> physical memory dropping below 175Mb.
>
>> -M800m should do more or less the right thing, but it is possible for
>> GHC to exceed this figure by a small percentage.
>
> Is there any chance there is a bug in recent GHCs (or perhaps Linux?)
> affecting this?  I'm fairly sure I've lately seen Haskell programs
> consuming significantly larger amounts of memory than they should be
> allowed to, and I can try to isolate a test case if it is of
> interest.

Please do isolate it if you can.  I'd be interested in investigating.

Cheers,
        Simon
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe