# Clover exceeding Java max memory using

**URL:** <https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850>\
**Category:** CloverDX Platform\
**Created:** [May 9, 2011, 12:00am UTC](https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850 "2011-05-09T00:00:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ken9iron](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@ken9iron](https://forum.cloverdx.com/u/ken9iron)\
**Post date:** [May 9, 2011, 12:00am UTC](https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850/1 "2011-05-09T00:00:00Z")

</div>

Hi,

We executing a Clover graph with many edges and using the defaultProperties to override the default Clover settings. The Clover graph fails to execute because it runs out of memory. Before the Clover graph is executed, we have over 6 GB of free memory available. As the Clover graphs is started, the free memory goes down and eventually the graph stops because it has run out of memory, even though we’ve set the max Java heap setting to 3 GB.

Here’s the command that I’m using to execute the graph:

java -Xmx3072m -Xss2048k -Xmso2048k -XX:+UseParallelGC -server -Djava.io.tmpdir=clover/graphs/data-tmp -classpath … -Dclover.home=“cloveretl” org.jetel.main.runGraph -cfg clover/graphs/workspace.prm clover/graphs/graph/test.grf -plugins cloveretl/plugins -config clover/defaultProperties -noJMX -v -loglevel TRACE -tracking 600 -P:fileInput=data/samples.dat

I’ve also attached the defaultProperties file that is being used.

Why does the Clover graph exceed the Java max memory setting of 3072m (3 GB)? How do we limit the Clover graph not to exceed using more than 3 GB of memory?

Thanks,  
Ken

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [May 9, 2011, 2:49pm UTC](https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850/2 "2011-05-09T14:49:30Z")

</div>

Hello Ken,  
you probably have components, that requires a lot of memory. There is only few general advices how to decrease memory requirements. First of all try to not use external jars in jdbc, jms connections - rather add them to the classpath when running graph. Also some components are memory gluttons and often can be replaced by others, that don’t require so much memory (e.g. HashJoin vs. MergeJoin). Some components can be adjusted by proper attributes values (see eg. [ExtSort vs. FastSort – which one is better for me?](http://blog.cloveretl.com/2010/06/15/extsort-vs-fastsort-%E2%80%93-which-one-is-better-for-me/)). But, when you suspect a graph to require too much memory, it requires an analysis for this concrete graph.

---

<div class="post-metadata">

**Author:** ![ken9iron](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@ken9iron](https://forum.cloverdx.com/u/ken9iron)\
**Post date:** [May 9, 2011, 8:20pm UTC](https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850/3 "2011-05-09T20:20:05Z")

</div>

Based on the log output attached, is there anything that sticks out that is eating up all the memory?

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [May 10, 2011, 7:48am UTC](https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850/4 "2011-05-10T07:48:36Z")

</div>

Can attach the log again? No attachment is visible in the post.

---

<div class="post-metadata">

**Author:** ![ken9iron](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@ken9iron](https://forum.cloverdx.com/u/ken9iron)\
**Post date:** [July 8, 2011, 7:02pm UTC](https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850/5 "2011-07-08T19:02:00Z")

</div>

Clover logs attached, including vmstat logs showing memory utilization.

- [log.zip](https://cdn.cloverdx.com/forum/13599%5F4b9b979945bfbea98b3aecf96299841d/log.zip)

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [July 12, 2011, 1:00pm UTC](https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850/6 "2011-07-12T13:00:51Z")

</div>

Hello Ken,  
the main problem in your graph is with huge amount of buffered edges. **Each** buffered edge allocates **two** buffers of **Record.MAX\_RECORD\_SIZE \* 10** size, and Record.MAX\_RECORD\_SIZE is 12kb (in CloverETL 2.9, in. 3.1 it is 64kb by default). Each direct edge allocates two buffers of Record.MAX\_RECORD\_SIZE \* 4 size. So I would advice to use rather direct edges, than buffered and decrease the Record.MAX\_RECORD\_SIZE in default properties file (see [Changing Default CloverETL Settings](http://www.cloveretl.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs/cloveretl-default-settings.html)).

---

<div class="post-metadata">

**Author:** ![ken9iron](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@ken9iron](https://forum.cloverdx.com/u/ken9iron)\
**Post date:** [July 18, 2011, 2:31pm UTC](https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850/7 "2011-07-18T14:31:42Z")

</div>

Thanks Agata. Would using direct edges change the functionality of the graph in any way compared to the buffered edges? i.e. Does it affect grouping and sorting, etc?

--Ken

---

<div class="post-metadata">

**Author:** ![avackova](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@avackova](https://forum.cloverdx.com/u/avackova)\
**Post date:** [July 19, 2011, 8:02am UTC](https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850/8 "2011-07-19T08:02:10Z")

</div>

Hello Ken,  
you can even use _directFastPropagate_ edges, that allocates buffers for one record only. If the buffered edge is required, CloverETL uses it independently what type is set by user.

---

<div class="post-metadata">

**Author:** ![ken9iron](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@ken9iron](https://forum.cloverdx.com/u/ken9iron)\
**Post date:** [July 19, 2011, 1:35pm UTC](https://forum.cloverdx.com/t/clover-exceeding-java-max-memory-using/850/9 "2011-07-19T13:35:27Z")

</div>

Thanks for your help, Agata.

--Ken
