On 25 Mai, 08:03, Brent Millare <brent.mill...@gmail.com> wrote: > Erik, what you said seems to make sense. So the question now is, since > a new classloader is started during each eval at the repl, does that > mean that it is closed after each repl statement? This seems to be the > case because after requiring a namespace in a previous command at the > repl, I can no longer reload that namespace with (require > 'foo :reload). However, because I am holding on to that namespace (as > I can access anything in that namespace I required), I feel that it > isn't completely unloaded. The natural follow up question would be, > does unloading the namespace required earlier then unload the > classloader? And, how does one test this? How does one obtain the > hierarchy of classloaders given you don't have references to the > children.
Don't know for sure, I think the ClassLoader and all classes loaded with it will be GC'ed if there are no more references to the old classes and the loader itself. Is there even a way to "close" a classloader? What do you mean by "can not longer reload that namespace"? To inspect objects of a running jvm, you can either use a debugger, or patch the clojure.lang.DynamicClassLoader code so that it puts reference into a static Var on each ctor call or such. The java debug interface alsow allows you to get a list of all classes/ objects currently available in the running vm, see http://java.sun.com/javase/6/docs/jdk/api/jpda/jdi/index.html BTW, are you aware that clojure haa aa "add-classpath" (marked as deprecated) function, wich will be removed in future versions, due to the problems it introduced wich java-dependencies? -- 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