Hello everyone,

I'm trying to parse a large number of small reports for some data and I'm 
doing this by repeatedly calling the following function (with a for) on 
each of the files:

(defn get-rep [file]
    (let [report (with-open [rdr (io/reader file)](*slurp rdr*))
          reg #";\s+(\d+\.\d+) \s+; (\d+\.\d+) \s+;"
          match (re-matcher reg report)
          found (re-find match)
          fmax-85c (second found)
          rfmax-85c (nth found 2)
          found2 (re-find match)
          fmax-0c (second found2)
          rfmax-0c (nth found2 2)]

          {:fmax-85c fmax-85c
          :rfmax-85c rfmax-85c
          :fmax-0c fmax-0c
          :rfmax-0c rfmax-0c}))

My problem is that after a while my program crashes with a jvm heap error, 
it crashes on the slurp line (in bold), although that probably doesn't mean 
much. The slurp line is the only one that I suspect since it's the biggest 
memory consumer in my program.
Now I'm wondering what's going on and why don't the report files get freed 
from memory. I'm suspecting this might be caused by lazyness at some level, 
but I can't figure out where. Any ideas?

Thanks!

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to