Re: Are strings expensive for memory on the JVM?

2013-01-05 Thread Marko Topolnik
> While it's true those fields aren't used any more, I was under the > impression at least one of those got replaced by the field used to cache > the new more-secure hashCode. > No, there is no trace of anything having changed with the *hashCode*. Here's the source code: java.lang.String

Re: Are strings expensive for memory on the JVM?

2013-01-05 Thread Aaron Cohen
On Sat, Jan 5, 2013 at 6:40 AM, Marko Topolnik wrote: > > On Saturday, January 5, 2013 12:35:27 PM UTC+1, Christian Sperandio wrote: >> >> About the String's expensiveness, working a lot with this kind of >> objects, it's big enough. In fact, that depends if you have a lot of small >> strings then

Re: Are strings expensive for memory on the JVM?

2013-01-05 Thread Christian Sperandio
Fine :) It's a nice improvement. Else, to have an idea about the memory management I found a good article again: http://www.ibm.com/developerworks/java/library/j-codetoheap/index.html It's interesting to understand the twists and turns of the JVM memory usage :) On 01/05/2013 12:40 PM, Mar

Re: Are strings expensive for memory on the JVM?

2013-01-05 Thread Marko Topolnik
On Saturday, January 5, 2013 12:35:27 PM UTC+1, Christian Sperandio wrote: > > About the String's expensiveness, working a lot with this kind of objects, > it's big enough. In fact, that depends if you have a lot of small strings > then the used memory space can become important. > For instance,

Re: Are strings expensive for memory on the JVM?

2013-01-05 Thread Christian Sperandio
About the String's expensiveness, working a lot with this kind of objects, it's big enough. In fact, that depends if you have a lot of small strings then the used memory space can become important. For instance, the word "Bazinga" takes almost 60 bytes in memory (for a 32bits JVM) in which 24 by

Re: Are strings expensive for memory on the JVM?

2013-01-05 Thread Marko Topolnik
> (swap! recent-activity concat feed @recent-activity) > This swap! replaces the value in recent-activity with (concat > @recent-activity feed @recent-activity), approximately > Adding to Stephen's point, *swap!* passes the current atom state into the function you gave it. So the cor

Re: Are strings expensive for memory on the JVM?

2013-01-04 Thread Matt Hoyt
Post the arguments you used to start the jvm. All you probably need to do is increase the Heap Space. If you are using the default jvm setting the default heap space is really small. To increase the space use the -Xmx(Size) flag. Its using StringBuilder which is the best way to create large str

Re: Are strings expensive for memory on the JVM?

2013-01-04 Thread Stephen Compall
On Jan 4, 2013 6:06 PM, "larry google groups" wrote: > (swap! recent-activity concat feed @recent-activity) This swap! replaces the value in recent-activity with (concat @recent-activity feed @recent-activity), approximately. -- Stephen Compall If anyone in the MSA is online, you sho

Are strings expensive for memory on the JVM?

2013-01-04 Thread larry google groups
I am still somewhat new to Clojure and the JVM. I am querying a database and trying to output some XML. For the XML, I am using this library: https://github.com/clojure/data.xml Apparently the database queries worked, and I was able to get the data into an XML structure, but at some point the