# Processing-java on Ubuntu Linux - Out of Memory issue

**URL:** <https://discourse.processing.org/t/processing-java-on-ubuntu-linux-out-of-memory-issue/16892>\
**Category:** Processing\
**Created:** [January 6, 2020, 4:23am UTC](https://discourse.processing.org/t/processing-java-on-ubuntu-linux-out-of-memory-issue/16892 "2020-01-06T04:23:54Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [January 7, 2020, 2:29am UTC](https://discourse.processing.org/t/processing-java-on-ubuntu-linux-out-of-memory-issue/16892/4 "2020-01-07T02:29:53Z")

</div>

Some post that are relevant but nothing conclusive:

- [Launch sketch with vm arguments](https://discourse.processing.org/t/launch-sketch-with-vm-arguments/15206)
- [swap - Java crash due to native memory allocation map failure, despite n - Server Fault](https://serverfault.com/questions/962275/java-crash-due-to-native-memory-allocation-map-failure-despite-n)
- [amazon web services - AWS: There is insufficient memory for the Java Runtime Environment to continue - Stack Overflow](https://stackoverflow.com/questions/42939413/aws-there-is-insufficient-memory-for-the-java-runtime-environment-to-continue)

* * *

- [How to pass arguments to the JVM using Sublime? - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/5848/how-to-pass-arguments-to-the-jvm-using-sublime)
- \*\* [Get command-line parameter in the new world of processing-java - Processing Forum](https://forum.processing.org/one/topic/get-command-line-parameter-in-the-new-world-of-processing-java.html)
- \*\* [Possible Memory Leak? - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/16362/possible-memory-leak)
- [Performance and Memory Issues - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/23111/performance-and-memory-issues)
- [Can't release PImage memory! - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/18762/can-t-release-pimage-memory)
- [How do I Increase Java Heap space on Mac? - Processing 2.x and 3.x Forum](https://forum.processing.org/two/discussion/19962/how-do-i-increase-java-heap-space-on-mac)

I am curious, are you running on BeamStalk or directly on a EC2?

From what I understand, the sketch runs fine with simple images. Can you describe what is a complex case? I am referring to:

> [@dandotdot](#):
>
> anything that isn’t dead simple

Here are some other ideas:

1. You need to confirm the issue is memory by using AWS monitoring. I believe you can use CloudWatch.
2. Try the image optimization on some of those links I shared above.
3. You are using `processing-java --run`. Have you consider exporting your application and calling the exported version?

I am not sure if you can pass memory flags to the jvm using `processing-java`. If option 3 above does not work, you can use the source code generated during the export application and build + run your application manually via `java` making sure you setup proper resource’s paths. I think I did this a while ago. If you get it to work locally, then you should be able to run the same command in your instance.

Kf

---

_[View the full topic](https://discourse.processing.org/t/processing-java-on-ubuntu-linux-out-of-memory-issue/16892)._
