[Haskell-cafe] Trying to fix space leak

2007-12-31 Thread Ben Challenor
Hi I'm learning Haskell through writing a compiler. I'm seeing huge memory use in a function which converts the dataflow graph to the form required by Data.Graph. It needs to return a map from dataflow nodes to Vertexs, a map in the other direction, and the list of edges (as Vertex pairs).

Re: [Haskell-cafe] Trying to fix space leak

2007-12-31 Thread Paul Johnson
Ben Challenor wrote: Hi I'm learning Haskell through writing a compiler. I'm seeing huge memory use in a function which converts the dataflow graph to the form required by Data.Graph. [...] I assume the allocation is being garbage-collected pretty quickly, because a) 6,616,297,296 bytes is

Re: [Haskell-cafe] Trying to fix space leak

2007-12-31 Thread Jake McArthur
On Dec 31, 2007, at 9:53 AM, Paul Johnson wrote: I'd advise against trying to make your program stricter because you might suddenly find yourself building an entire 6GB structure in memory before traversing it, which would not be a Good Thing. I disagree. It might be the case that the