On May 28, 2013, at 5:10 PM, Alan Malloy wrote:
> 
> The principal problem of disabling locals-clearing is not "slowing things 
> down", but rather causing perfectly reasonable code to consume unbounded 
> memory. For example, consider: ((fn [xs] (nth xs 1e8)) (range)). With locals 
> clearing, the compiler makes sure that xs is available for GC as it is being 
> processed, so that the working-set size is small. If locals clearing is 
> disabled, the local reference xs is kept around in case a debugger wants to 
> look at it, and so the head of xs is being held while it is realized, meaning 
> a hundred-million-element range must be kept in memory until the function 
> call completes.
> 
> It's definitely useful to be able to disable locals-clearing temporarily 
> while debugging, but doing so in any kind of production app would be a 
> disaster.

Shouldn't it be possible, at least in principle, to retain only those things 
that could be referenced at the point of the error? In other words, if you can 
GC it under normal circumstances then go ahead and GC it. If you can't, then 
don't (of course), and when we hit an exception then we want to be able to see 
whatever is still around (or if that's hard for tails of lazy sequences or for 
any other reason, then punt on this stuff).

I obviously don't know the guts of the JVM, but I think that something like 
this is what's wanted.

 -Lee

-- 
-- 
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