vendredi 22 mai 2015

Processing huge set of string in java [duplicate]

This question already has an answer here:

I have a requirement to process a large result set of Strings. What I have is List<Object[]> where Object[] contains a value and a date. I'm using a forward only cursor in hibernate, so i have the best optional speed in the database access and I have also disabled hibernate caching at this point.

In an average this list has a size of 100000 elements (100k elements).

Then I'm scaling each of the value and date. I use ExecutorService with a size of 5 threads. So each with 20k elements. I'm using StringBuilder for each thread.

In worst case the size of the list may go up to 200k elements.

Problem: Some time I'm getting an OOM (Out Of Memory exception). I have increased the heap space of the JVM. Still I'm getting the same at some point.

Do you have any suggestion to increase the speed and performance for solving this issue ?

Aucun commentaire:

Enregistrer un commentaire