Social and professional networking

View Ian Clarke's profile on LinkedIn
Shameless plug

Does your company's revenue depend on being able to predict the future based on past data?  SenseArray may be able to help.

RSS
Links
« Edit music just like you would edit a photo | Main | The American media's obsession with identity politics »
Wednesday
Apr162008

Don't try to serialize large ConcurrentSkipListMaps

Today I learned the hard way that Java can't serialize large ConcurrentSkipListMaps (and probably ConcurrentSkipListSets too). The issue is that there doesn't seem to be any custom serialization implementation for this class, and the default serialization mechanism ends up joyfully recursing its way along the map's internal object graph - eventually causing a StackOverflowException. Nice.

The root issue here is, of course, Java's default serialization mechanism, which really shouldn't operate recursively like this. Turns out that this has been a known issue for an embarrassing length of time (see this 9 year old bug report).

The workaround is to subclass ConcurrentSkipListMap providing a more efficient serialization mechanism - actually its not too hard, the code is here. Its public domain, so enjoy!

Reader Comments (1)

A sail veering about the blank bay waiting for a swollen designer sunglasses wholesale bundle to bob up, roll over to the sun a puffy replica sunglasses wholesale face, salt white. Here I am. They followed the winding path down to the creek. Buck Mulligan stood on a stone, in shirtsleeves, his wholesale cheap sunglasses unclipped tie rippling over his shoulder. A young man clinging to a spur of rock near him moved slowly frogwise his green sunglass wholesale legs in the deep jelly of the water. Buck Mulligan sat down to unlace his wholesale oakley sunglasses boots. An elderly man shot up near the spur of rock a blowing red sunglasses for wholesale face. He scrambled up by the stones, water glistening on his fashion sunglasses wholesale pate and on its garland of grey hair, water rilling over his chest and paunch and spilling jets out of his wholesale sunglasses china black sagging loincloth.

July 13, 2010 | Unregistered Commentersunglass wholesale

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>