Memory issues with Ardublock v20131031 and Arduino 1.5.5 #77

Open
GreggShort opened this Issue Dec 27, 2013 · 5 comments

Projects

None yet

5 participants

@GreggShort

When I try and open a second sketch (.ino NOT an .abp), I'm getting a stack heap error when ardublock v20131031 is installed as a tool. (Windows 8.1) Not sure if the problem is a memory leak with ardublock, or the allocated memory in configuration.txt needs to be increased. Problem goes away if I rename the tools directory (holding ardublock) to "fubar-tools"

Here's an example error.

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at javax.swing.JScrollPane.createViewport(Unknown Source)
at javax.swing.JScrollPane.(Unknown Source)
at edu.mit.blocks.codeblockutil.CTracklessScrollPane$1.(CTracklessScrollPane.java:146)
at edu.mit.blocks.codeblockutil.CTracklessScrollPane.(CTracklessScrollPane.java:148)
at edu.mit.blocks.codeblockutil.CPopupMenu.(CPopupMenu.java:41)
at edu.mit.blocks.codeblockutil.LabelWidget$LabelMenu.(LabelWidget.java:511)
at edu.mit.blocks.codeblockutil.LabelWidget$LabelMenu.(LabelWidget.java:506)
at edu.mit.blocks.codeblockutil.LabelWidget.(LabelWidget.java:52)
at edu.mit.blocks.renderable.BlockLabel$1.(BlockLabel.java:81)
at edu.mit.blocks.renderable.BlockLabel.(BlockLabel.java:81)
at edu.mit.blocks.renderable.SocketLabel.(SocketLabel.java:15)
at edu.mit.blocks.renderable.RenderableBlock.synchronizeSockets(RenderableBlock.java:544)
at edu.mit.blocks.renderable.RenderableBlock.(RenderableBlock.java:249)
at edu.mit.blocks.renderable.RenderableBlock.(RenderableBlock.java:186)
at edu.mit.blocks.renderable.FactoryRenderableBlock.(FactoryRenderableBlock.java:40)
at edu.mit.blocks.workspace.PageDrawerLoadingUtils.loadBlockDrawerSets(PageDrawerLoadingUtils.java:236)
at edu.mit.blocks.workspace.Workspace.loadWorkspaceFrom(Workspace.java:849)
at edu.mit.blocks.controller.WorkspaceController.loadFreshWorkspace(WorkspaceController.java:397)
at com.ardublock.core.Context.resetWorksapce(Context.java:110)
at com.ardublock.core.Context.(Context.java:76)
at com.ardublock.core.Context.getContext(Context.java:63)
at com.ardublock.ui.OpenblocksFrame.(OpenblocksFrame.java:71)
at com.ardublock.ui.ArduBlockToolFrame.(ArduBlockToolFrame.java:3)
at com.ardublock.ArduBlockTool.init(ArduBlockTool.java:28)
at processing.app.Editor.addTools(Editor.java:824)
at processing.app.Editor.buildToolsMenu(Editor.java:693)
at processing.app.Editor.buildMenuBar(Editor.java:486)
at processing.app.Editor.(Editor.java:212)
at processing.app.Base.handleOpen(Base.java:846)
at processing.app.Base.handleOpen(Base.java:811)
at processing.app.Base$8.actionPerformed(Base.java:1604)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)

@taweili
Owner
taweili commented Dec 27, 2013

What happened if you increase the heap size? If memory serves, the default value is quite low and ardublock does take up a good chunk of memory.

@TonyCallear
Contributor

If it helps at all Arduino v1.05 also gives a similar error after opening four new sketches from the file menu of one intial instance. Any number of Arduino IDE's start correctly if from the windows 'Start' menu.

I would have tried to help with increasing JAVA heap space but don't know how to do that. At least nothing I do in "C:\Program Files (x86)\Arduino\lib\Preferences.txt" makes any difference.

Arduino Version: 1.0.5
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferInt.(DataBufferInt.java:41)
at java.awt.image.Raster.createPackedRaster(Raster.java:458)
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)
at java.awt.GraphicsConfiguration.createCompatibleImage(GraphicsConfiguration.java:163)
at edu.mit.blocks.codeblockutil.GraphicsManager.getGCCompatibleImage(GraphicsManager.java:39)
at edu.mit.blocks.renderable.RenderableBlock.updateBuffImg(RenderableBlock.java:1378)
at edu.mit.blocks.renderable.RenderableBlock.(RenderableBlock.java:271)
at edu.mit.blocks.renderable.RenderableBlock.(RenderableBlock.java:186)
at edu.mit.blocks.renderable.FactoryRenderableBlock.(FactoryRenderableBlock.java:40)
at edu.mit.blocks.workspace.PageDrawerLoadingUtils.loadBlockDrawerSets(PageDrawerLoadingUtils.java:236)
at edu.mit.blocks.workspace.Workspace.loadWorkspaceFrom(Workspace.java:849)
at edu.mit.blocks.controller.WorkspaceController.loadFreshWorkspace(WorkspaceController.java:397)
at com.ardublock.core.Context.resetWorksapce(Context.java:110)
at com.ardublock.core.Context.(Context.java:76)
at com.ardublock.core.Context.getContext(Context.java:63)
at com.ardublock.ui.OpenblocksFrame.(OpenblocksFrame.java:71)
at com.ardublock.ui.ArduBlockToolFrame.(ArduBlockToolFrame.java:3)
at com.ardublock.ArduBlockTool.init(ArduBlockTool.java:28)
at processing.app.Editor.addTools(Editor.java:794)
at processing.app.Editor.buildToolsMenu(Editor.java:670)
at processing.app.Editor.buildMenuBar(Editor.java:476)
at processing.app.Editor.(Editor.java:205)
at processing.app.Base.handleOpen(Base.java:705)
at processing.app.Base.handleOpen(Base.java:670)
at processing.app.Base$7.actionPerformed(Base.java:1104)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1225)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1266)

@taweili
Owner
taweili commented Jul 4, 2014

The default memory maximum for Arduino IDE is 256 as defined in preferences.txt and this would be too small loading large tools like Ardublock.

run.options.memory.maximum=256

@taweili taweili added the bugs label Jul 4, 2014
@JustFormat

I have the same problem how can i change that.

@multiplo

You should edit the file inside of Contents/Resources/Java/lib/preferences.txt and replace the line for run.options.memory.maximum=256 with another value like 512 ( that worked in my case at least )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment