Re: "containing" memory-consuming computations

2012-07-16 Thread Ryan Newton
Simon mentioned a system of doing multiple GC's to measure actual live data. But wouldn't a more limited alternative be capping *allocation* rather than live data? GHC already has an mechanism to preempt IO threads based on an allocation trip wire. In fact that's *the* preemption mechanism. Isn

Re: "containing" memory-consuming computations

2012-04-20 Thread Edward Z. Yang
Excerpts from Brandon Allbery's message of Fri Apr 20 19:31:54 -0400 2012: > > So, it would be pretty interesting if we could have an ST s style > > mechanism, where the data structure is not allowed to escape. > > But I wonder if this would be too cumbersome for anyone to use. > > Isn't this what

Re: "containing" memory-consuming computations

2012-04-20 Thread Brandon Allbery
On Fri, Apr 20, 2012 at 12:56, Edward Z. Yang wrote: > So, it would be pretty interesting if we could have an ST s style > mechanism, where the data structure is not allowed to escape. > But I wonder if this would be too cumbersome for anyone to use. > Isn't this what monadic regions are for? -

Re: "containing" memory-consuming computations

2012-04-20 Thread Edward Z. Yang
So, it would be pretty interesting if we could have an ST s style mechanism, where the data structure is not allowed to escape. But I wonder if this would be too cumbersome for anyone to use. Edward Excerpts from Simon Marlow's message of Fri Apr 20 06:07:20 -0400 2012: > On 19/04/2012 11:45, Her

Re: "containing" memory-consuming computations

2012-04-20 Thread Simon Marlow
On 19/04/2012 11:45, Herbert Valerio Riedel wrote: > For the time-dimension, I'm already using functions such as > System.Timeout.timeout which I can use to make sure that even a (forced) > pure computation doesn't require (significantly) more wall-clock time > than I expect it to. Note that tim

Re: "containing" memory-consuming computations

2012-04-19 Thread Bardur Arantsson
On 04/19/2012 12:45 PM, Herbert Valerio Riedel wrote: Hello GHC Devs, > But I'm missing a similar facility for constraining the space-dimension. In some other languages such as C, I have (more or less) the ability to check for /local/ out-of-memory conditions (e.g. by checking the return value

Re: "containing" memory-consuming computations

2012-04-19 Thread Herbert Valerio Riedel
Ryan Newton writes: > It sounds like you're interested in running just one client computation at > once? Actually, I was hoping for a more general solution, which is also applicable to e.g. a web-server running with `+RTS -N8`, where each HTTP request spawns a new thread, and multiple requests

Re: "containing" memory-consuming computations

2012-04-19 Thread Ryan Newton
Hi Herbert, It sounds like you're interested in running just one client computation at once? Hence you don't have a disambiguation problem -- if the total memory footprint crosses a threshold you know who to blame. At least this seems easier than needing a per-computation or per-IO-thread caps.