space-leak Questions

1

I have a space leak in my Haskell programm, I could pinpoint it to a minimal example as follows. I would expect the following code (albeit not terminating but I don't care) to run in constant memor...
Jaco asked 14/12, 2023 at 21:9

2

I have a directory of <20MB pdf files (each pdf represents an ad) on an AWS EC2 large instance. I'm trying to upload each pdf file to S3 using ruby and DM-Paperclip. Most files upload successf...
Pareira asked 15/8, 2013 at 1:14

2

Solved

My space leak happens in one of my personal project. But I don't want someone to solve it in my project. I want to understand it. I reproduced my space leak by making up this algorithm: u is a se...
Ronironica asked 30/4, 2015 at 3:30

2

Solved

On reflection, this entire question can be boiled down to something much more concise. I'm looking for a Haskell data structure that looks like a list has O(1) lookup has either O(1) element repl...
Holmium asked 20/3, 2014 at 6:37

1

Solved

I wanted to write an efficient implementation of the Floyd-Warshall all pairs shortest path algorithm in Haskell using Vectors to hopefully get good performance. The implementation is quite straig...
Paeon asked 7/10, 2013 at 8:45

2

Solved

I am confused by the behaviour of the following snipped: import Data.Int import Data.Array.ST import Control.Monad.ST {-# INLINE fib #-} fib _ 0 = return 0 fib _ 1 = return 1 fib c n = do f1 &lt...
Aiguillette asked 23/2, 2013 at 7:49

1

Solved

I'm new to Haskell and I'm trying to implement Euler's Sieve in stream processing style. When I checked the Haskell Wiki page about prime numbers, I found some mysterious optimization technique fo...

1

Solved

The mapAndSum function in the code block all the way below combines map and sum (never mind that another sum is applied in the main function, it just serves to make the output compact). The map is ...
Dijon asked 24/7, 2012 at 7:11

2

I type this code into the interpreter and memory is rapidly consumed: last [1..10^7] `seq` () I can't see why this needs more than O(1) space. If i do just (which should be the same, because Sho...
Hatching asked 29/5, 2012 at 5:12

2

I have read it many times that lazy evaluation in Haskell may sometimes lead to space leaks. What kind of code can lead to space leaks? How to detect them? And what precautions can be taken on part...
Jamnes asked 14/10, 2011 at 13:43

3

Solved

I've been playing with the Writer Monad recently, and I've run into what appears to be a space leak. I can't say I fully understand these things yet, so I'd like to know what's happening here, and ...
Delete asked 11/10, 2011 at 2:54
1

© 2022 - 2025 — McMap. All rights reserved.