Open apraga opened 7 years ago
What precisely do you mean by crash? Keep in mind that heap representations (especially your particular Particle
representation) are generally larger than their on-disk representation. Are you certain you aren't simply running out of memory?
Thanks for the quick answer. By "crash", I mean the computer freezes and becomes unresponsive.
I've monitored memory usage and you are right, I'm running out of memory. Is there a way to decrease memory usage of my program ?
Looking at your program, a few things stand out:
Scientific
. Each of these will take at least three machine words. If you need the precision then this might be acceptable, but if not you are likely going to be better of using Double
.pos
field will require 5 words for each element, or 15 words in total.Integers
. Integer
s are only slightly larger than Int
(two words instead of one), but you likely don't need the range here.@alexDarcy, see https://github.com/bgamari/memory-reduction for a few examples. Come find me in #haskell
on irc.freenode.net
if you want to chat about your problem.
Hi,
I've implemented a parser using Attoparsec, which works very well. Unfortunately, for a large file (one of 1.2Go), running the parser makes it crash on my Ubuntu 16.04.2 LTS. I'm using attoparsec 0.13.1.0 with stack.
Below is the complete code for the parser. As a example, a small file is also given to have an idea of the file format. small_test.txt
If someone is interested, I can give the large file making the parser crash. Thanks.