# Processing.video causes VM failure

**URL:** https://discourse.processing.org/t/processing-video-causes-vm-failure/11153
**Category:** Libraries
**Created:** [May 12, 2019, 6:12am UTC](https://discourse.processing.org/t/processing-video-causes-vm-failure/11153 "2019-05-12T06:12:45Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![simonbiggs](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@simonbiggs](https://discourse.processing.org/u/simonbiggs)
#### Post date: [May 12, 2019, 6:12am UTC](https://discourse.processing.org/t/processing-video-causes-vm-failure/11153/1 "2019-05-12T06:12:45Z")

</div>

Hi everyone.  
I have been running Processing 2.2.1 on a Macbook Pro 2014 with the processing.video library no problems. I am now moving the project to a Mac Pro (tower) 2017 model. Importing the processing.video library doesn’t bother it. Creating a variable of the class Capture doesn’t bother it:  
Capture video;  
However, as soon as I try to use that variable, like this:  
video=new capture(this,camera[1]);  
I get the following error:  
“Could not run the sketch (Target VM failed to initialize). Make sure you haven’t set the maximum available memory too high.”  
I’ve seen this error before, such as when trying to use the fullscreen() function with a renderer (P3D/P2D/OPENGL) argument in Processing 3 (it is partly because of this problem I am using Processing 2.2.1).  
Does anyone have any thoughts?

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [May 12, 2019, 7:00am UTC](https://discourse.processing.org/t/processing-video-causes-vm-failure/11153/2 "2019-05-12T07:00:00Z")

</div>

even if processing 2.2.1 might be still supported  
you should think about using / and learning / current 3.5.3 version  
[https://processing.org/download/](https://processing.org/download/)

and upgrade your code too to the current version.

* * *

but for the main question  
errors when using a library?  
when working with different versions must use different sketch\_book setups  
as the loaded ( and valid ) libraries are part of that path.  
most probably you mixed new processing version with old libraries when copy  
that whole sketch\_book path to new computer?

---

<div class="post-metadata">

### Author: ![simonbiggs](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@simonbiggs](https://discourse.processing.org/u/simonbiggs)
#### Post date: [May 13, 2019, 12:02am UTC](https://discourse.processing.org/t/processing-video-causes-vm-failure/11153/3 "2019-05-13T00:02:13Z")

</div>

Thanks for the advice kll. The project this code is part of uses a number of libraries that are not supported by Processing 3.x and for which there are no current equivalents, so it needs to use 2.2.1. For other projects I use 3.x as well as P5.js, so I’m quite familiar with the different flavours.  
I have another more recent project that uses the same libraries as the one I am having problems with (the problem file uses one extra library, processing.video). When I add it to the newer project I do not get the error. I think the best way forward is to strip out code I am not using in the problem project from the newer project and then step by step add the code that is distinctive to see if and when it breaks. Both are very complicated projects with many classes, using physics engines, live video, kinect input and other elements.  
I note that the Target VM error also occurs in Processing 3.x with certain bits of code, especially the fullScreen() function. Looking at other’s discussion of this it seems to arise with certain versions of Processing, OS’s and graphics cards. That can make things hard to fix, especially as there is so little documentation, and some approaches become impossible in certain contexts, which is very frustrating.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [May 16, 2019, 1:37pm UTC](https://discourse.processing.org/t/processing-video-causes-vm-failure/11153/4 "2019-05-16T13:37:28Z")

</div>

Were you able to resolve this? If not, can you post the full error text?

---

<div class="post-metadata">

### Author: ![simonbiggs](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@simonbiggs](https://discourse.processing.org/u/simonbiggs)
#### Post date: [May 16, 2019, 11:41pm UTC](https://discourse.processing.org/t/processing-video-causes-vm-failure/11153/5 "2019-05-16T23:41:56Z")

</div>

The project has thousands of line of code. Runs fine on the development machine. Just doesn’t run on other machines. No useful error text - just says “Could not run the sketch (Target VM failed to initialize). Make sure you haven’t set the maximum available memory too high.”  
My suspicion is that it is a dependency issue rather than a code or version issue. For the moment I am continuing to develop on the development machine. I know it is when I invoke the processing.video library that the project breaks, so it’s to do with that. As kll pointed out, it’s probably a path issue, although I’ve tried re-importing the library and that didn’t fix it. That was confusing.

---

<div class="post-metadata">

### Author: ![olgv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/olgv/32/8330_2.png) [@olgv](https://discourse.processing.org/u/olgv)
#### Post date: [March 7, 2020, 11:07pm UTC](https://discourse.processing.org/t/processing-video-causes-vm-failure/11153/6 "2020-03-07T23:07:39Z")

</div>

Hi guys,

I am failing to run **GettingStartedCapture.pde** , listing:

> Processing video library using GStreamer 1.16.0  
> Could not run the sketch (Target VM failed to initialize).

I got there after trying to run **TimeDisplacement.pde** and failing at line 22 `new Capture`

I am using:  
Processing: v3.5.4  
Processing Video: v2.0-beta4  
MacOS: v10.14.6 (Mojave)

Any help is appreciated.

---

<div class="post-metadata">

### Author: ![Maciek](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@Maciek](https://discourse.processing.org/u/Maciek)
#### Post date: [May 4, 2020, 10:18am UTC](https://discourse.processing.org/t/processing-video-causes-vm-failure/11153/7 "2020-05-04T10:18:38Z")

</div>

did you get an answer for your problem. Because im facing this same error

---

<div class="post-metadata">

### Author: ![Maciek](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@Maciek](https://discourse.processing.org/u/Maciek)
#### Post date: [May 4, 2020, 11:46am UTC](https://discourse.processing.org/t/processing-video-causes-vm-failure/11153/8 "2020-05-04T11:46:48Z")

</div>

> <https://github.com/processing/processing-video/issues/134#issuecomment-617301980>
>
> Running the example file that comes with the Processing video library throws the following error:
> libc++abi.dylib: terminating with uncaught exception of type...

  
this works for me!
