Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Space leak in luDecomp #16

Open
kenta2 opened this issue Mar 22, 2015 · 1 comment
Open

Space leak in luDecomp #16

kenta2 opened this issue Mar 22, 2015 · 1 comment

Comments

@kenta2
Copy link

kenta2 commented Mar 22, 2015

luDecomp appears to have a space leak: calling it on a 100x100 matrix of Doubles requires over 5 GB of memory. Here is a simple test program

{-# LANGUAGE LambdaCase #-}
module Main where {
import Data.Matrix;
import System.Environment(getArgs);

main::IO();
main= getArgs >>= \case {
[n] -> print $ detLU $ randommatrix $ read n;
_ -> error "need matrix size";
};

randommatrix :: Int -> Matrix Double;
randommatrix size = fromList size size
-- crude random number generator
$ map (tan . fromIntegral) $ enumFromTo 1 $ size * size;

} --end

Seen in matrix-0.3.4.2 with GHC 7.8.4
and github version of matrix, with GHC 7.10 rc1

@Daniel-Diaz
Copy link
Owner

Yes, that is certainly a bad memory usage case. I don't have much time right now to look at this, but will do as soon as I can.

Thanks for reporting this.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants