Skip to content

Auto-format causes Java heap overflow [imported] #1088

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

Closed
cmaglie opened this issue Nov 15, 2012 · 1 comment
Closed

Auto-format causes Java heap overflow [imported] #1088

cmaglie opened this issue Nov 15, 2012 · 1 comment
Assignees
Milestone

Comments

@cmaglie
Copy link
Member

cmaglie commented Nov 15, 2012

This is Issue 1088 moved from a Google Code project.
Added by 2012-10-30T05:59:34.000Z by n...@gammon.com.au.
Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Defect, Priority-Medium

Original description

What steps will reproduce the problem?

  1. Open the attached file with the IDE
  2. Attempt an auto-format

What is the expected output? What do you see instead?

I expect the code to be formatted.

Instead:

First time, the IDE went into a loop and had to be forced-quit.

Second time:

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
at java.lang.StringBuffer.append(StringBuffer.java:224)
at processing.app.tools.AutoFormat.indent_puts(AutoFormat.java:170)
at processing.app.tools.AutoFormat.run(AutoFormat.java:652)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:702)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:663)
at java.awt.EventQueue$2.run(EventQueue.java:661)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:672)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

What version of the Arduino software are you using? On what operating
system? Which Arduino board are you using?

IDE 1.0.1
Mac OS/X
Board not relevant

Please provide any additional information below.

@ffissore
Copy link
Contributor

Latest nightly build of the IDE includes a new code formatter, based on astyle, that behaves as expected. Please not that the attached sketch will be badly formatter because of a missing / at line 5

*
This function shifts all the LED data out to the TLC5947's. 
*/

should be

/*
This function shifts all the LED data out to the TLC5947's. 
*/

@ghost ghost assigned ffissore Oct 15, 2013
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