Re: Something hanging onto the head?

2010-09-24 Thread Per Vognsen
The namespace binding is what's holding onto the head. This is a
common enough question (which tends to occur more in toy programs than
real ones) that it probably belongs in a FAQ.

-Per

On Fri, Sep 24, 2010 at 9:58 PM, Jeff Palmucci jpalmu...@gmail.com wrote:
 Sorry, I posted this question and it turned up under the 1.3 Alpha 1
 thread. Apparently you cannot reply to an email from the group, edit
 the header, and start a new discussion. Here it is again:

 I have a very simple test case in clojure 1.2:
 (def *1* (count (range 0 1)))
 I have a loop running in another thread that periodically causes a
 full gc and then prints the amount of used memory every 2 seconds.
 Evaluating the above form, I get:
 Used memory: 0.079951296 G
 Used memory: 0.32577516 G
 Used memory: 0.847947752 G
 Used memory: 1.377162736 G
 Used memory: 1.878349032 G
 Used memory: 2.202150656 G
 Used memory: 2.686696656 G
 Used memory: 3.14701836 G
 ...
 Seems like something is holding onto the front of the sequence.
 However, if I use the following instead:
 (def *1* (#(count (range 0 1
 The problem goes away:
 Used memory: 0.07999508 G
 Used memory: 0.0799572 G
 Used memory: 0.07999796 G
 Used memory: 0.079997392 G
 Used memory: 0.111486904 G
 Used memory: 0.079995512 G
 Used memory: 0.11590836 G
 Used memory: 0.080138968 G
 Used memory: 0.080005136 G
 Used memory: 0.079963912 G
 Used memory: 0.07996396 G
 Used memory: 0.079964008 G
 Any ideas?

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


Re: Something hanging onto the head?

2010-09-24 Thread Laurent PETIT
Which namespace binding ?

Isn't 'count eager ?

2010/9/24 Per Vognsen per.vogn...@gmail.com

 The namespace binding is what's holding onto the head. This is a
 common enough question (which tends to occur more in toy programs than
 real ones) that it probably belongs in a FAQ.

 -Per

 On Fri, Sep 24, 2010 at 9:58 PM, Jeff Palmucci jpalmu...@gmail.com
 wrote:
  Sorry, I posted this question and it turned up under the 1.3 Alpha 1
  thread. Apparently you cannot reply to an email from the group, edit
  the header, and start a new discussion. Here it is again:
 
  I have a very simple test case in clojure 1.2:
  (def *1* (count (range 0 1)))
  I have a loop running in another thread that periodically causes a
  full gc and then prints the amount of used memory every 2 seconds.
  Evaluating the above form, I get:
  Used memory: 0.079951296 G
  Used memory: 0.32577516 G
  Used memory: 0.847947752 G
  Used memory: 1.377162736 G
  Used memory: 1.878349032 G
  Used memory: 2.202150656 G
  Used memory: 2.686696656 G
  Used memory: 3.14701836 G
  ...
  Seems like something is holding onto the front of the sequence.
  However, if I use the following instead:
  (def *1* (#(count (range 0 1
  The problem goes away:
  Used memory: 0.07999508 G
  Used memory: 0.0799572 G
  Used memory: 0.07999796 G
  Used memory: 0.079997392 G
  Used memory: 0.111486904 G
  Used memory: 0.079995512 G
  Used memory: 0.11590836 G
  Used memory: 0.080138968 G
  Used memory: 0.080005136 G
  Used memory: 0.079963912 G
  Used memory: 0.07996396 G
  Used memory: 0.079964008 G
  Any ideas?
 
  --
  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.comclojure%2bunsubscr...@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 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.comclojure%2bunsubscr...@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 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