On Sat, Nov 29, 2008 at 5:28 AM, Lemmih <[EMAIL PROTECTED]> wrote: > > Hiya, > > I noticed something weird while editing this 987 lines long file > http://code.haskell.org/lhc/src/Main.hs. > > The memory usage is collected via +RTS -sstderr. > Just opening the file takes 3 MB. So far so good. > Scrolling to the end of the page raises the memory usage to 52 MB (1 > MB lost due to fragmentation). > Inserting a single space at the end of the file raises memory usage to > 129 MB (2 MB lost due to fragmentation).
This is can be explained by the strategy used for parsing http://yi-editor.blogspot.com/2008/11/incremental-parsing-in-yi.html Moving to the end of file forces the AST; editing forces the lists of intermediate states. At the moment the intermediate parsing states are saved for every single token, I imagine this is the culprit for using so much memory. It's an easy fix though. > Inserting a bunch of spaces increases the memory usage to 192 MB (3 MB lost). I'm unsure if this is normal or not. Hopefully there should not be actual memory leaks. > This is with the darcs version of yi (with 2797 patches) compiled with > GHC-6.10.1. I'm using the emacs keymap if that matters. > Thanks for the comments! -- JP --~--~---------~--~----~------------~-------~--~----~ Yi development mailing list yi-devel@googlegroups.com http://groups.google.com/group/yi-devel -~----------~----~----~----~------~----~------~--~---