# Not enough memory while referencing array

**URL:** <https://discourse.processing.org/t/not-enough-memory-while-referencing-array/18787>\
**Category:** Libraries\
**Created:** [March 19, 2020, 9:48am UTC](https://discourse.processing.org/t/not-enough-memory-while-referencing-array/18787 "2020-03-19T09:48:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BongoTurtle](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@BongoTurtle](https://discourse.processing.org/u/BongoTurtle)\
**Post date:** [March 19, 2020, 9:48am UTC](https://discourse.processing.org/t/not-enough-memory-while-referencing-array/18787/1 "2020-03-19T09:48:41Z")

</div>

I am trying to create a simulation of an ocean and I need to be able to move fish around based on a background fluid. When I try to do this I get a message saying “Could not run the sketch (Target VM failed to initialize).  
Make sure that you haven’t set the maximum available memory too high.  
For more information, read revisions.txt and Help ? Troubleshooting.”  
This happens after a few seconds of trying to access the fluid’s velocity in the pixelFlow library. It doesn’t seem to matter how many fish I have referencing this fluid, it still takes a similar amount of time. I have tried changing the maximum available memory in preferences but it doesn’t seem to make any difference. Also I have 8G of ram which should be more than enough for what I am trying to do. Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [March 19, 2020, 10:42am UTC](https://discourse.processing.org/t/not-enough-memory-while-referencing-array/18787/2 "2020-03-19T10:42:50Z")

</div>

> [@BongoTurtle](#):
>
> Make sure that you haven’t set the maximum available memory too high.

Maybe you should try to reduce the memory because that what it says

---

<div class="post-metadata">

**Author:** ![BongoTurtle](https://avatars.discourse-cdn.com/v4/letter/b/df788c/32.png) [@BongoTurtle](https://discourse.processing.org/u/BongoTurtle)\
**Post date:** [March 19, 2020, 10:43pm UTC](https://discourse.processing.org/t/not-enough-memory-while-referencing-array/18787/3 "2020-03-19T22:43:04Z")

</div>

I tried that but it doesn’t seem to have any effect
