Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out Of Memory Error adding webcam #979

Open
JLLeitschuh opened this issue Oct 18, 2021 · 1 comment
Open

Out Of Memory Error adding webcam #979

JLLeitschuh opened this issue Oct 18, 2021 · 1 comment
Milestone

Comments

@JLLeitschuh
Copy link
Member

Running v1.6.0 Release Candidate 4 published from the release on MacOS Big Sur (11.6) I get the following exception in the log when attempting to add a webcam.

Oct 18, 2021 3:07:51 PM edu.wpi.grip.core.GripCoreModule onThreadException
SEVERE: Error from Thread[JavaFX Application Thread,5,main]
java.lang.OutOfMemoryError: Physical memory usage is too high: physicalBytes (478M) > maxPhysicalBytes (400M)
	at org.bytedeco.javacpp.Pointer.deallocator(Pointer.java:584)
	at org.bytedeco.javacpp.Pointer.init(Pointer.java:124)
	at org.bytedeco.javacpp.opencv_core$Mat.allocate(Native Method)
	at org.bytedeco.javacpp.opencv_core$Mat.<init>(opencv_core.java:19355)
	at edu.wpi.grip.core.sources.CameraSource.<init>(CameraSource.java:82)
	at edu.wpi.grip.core.sources.CameraSource.<init>(CameraSource.java:99)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source)
	at com.google.inject.internal.DefaultConstructionProxyFactory$ReflectiveProxy.newInstance(DefaultConstructionProxyFactory.java:126)
	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
	at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
	at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015)
	at com.google.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:776)
	at com.sun.proxy.$Proxy21.create(Unknown Source)
	at edu.wpi.grip.ui.pipeline.AddSourceButton.lambda$new$2(AddSourceButton.java:171)
	at edu.wpi.grip.ui.pipeline.AddSourceButton.lambda$loadCamera$16(AddSourceButton.java:318)
	at java.base/java.util.Optional.ifPresent(Unknown Source)
	at edu.wpi.grip.ui.pipeline.AddSourceButton.loadCamera(AddSourceButton.java:315)
	at edu.wpi.grip.ui.pipeline.AddSourceButton.lambda$new$4(AddSourceButton.java:168)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.control.MenuItem.fire(MenuItem.java:465)
	at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1380)
	at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(ContextMenuContent.java:1333)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$MouseHandler.process(Scene.java:3851)
	at javafx.scene.Scene$MouseHandler.access$1200(Scene.java:3579)
	at javafx.scene.Scene.processMouseEvent(Scene.java:1849)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2588)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:397)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:434)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:390)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:433)
	at com.sun.glass.ui.View.handleMouseEvent(View.java:556)
	at com.sun.glass.ui.View.notifyMouse(View.java:942)
	at com.sun.glass.ui.mac.MacView.notifyMouse(MacView.java:127)

@JLLeitschuh JLLeitschuh added this to the v1.6.0 milestone Oct 18, 2021
@w8wjb
Copy link

w8wjb commented Jan 14, 2022

Right now, the max memory is set to 200M: -Xmx200M

To increase this in the build, it can be changed in in ui/ui.gradle.kts:

jvmArgs.setAll("-Xmx1024M")

Otherwise, if you're needing to change it in an already-built application, this setting ends up in GRIP.app/Contents/app/GRIP.cfg. There, it appears as:

java-options=-Xmx200M

which can be increased as necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants