I have a problem with my code where I added 2.25 million numbers to a float 2D array, and depending on the computer the program either does not run or gives a string of errors. I was wondering if there is a way to either fix this problem or find the limit to a 2D float array. Here the errors are:
Exception in thread "ECS"
java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.eclipse.jdt.internal.compiler.ast.IntLiteral.buildIntLiteral(IntLiteral.java:54)
at org.eclipse.jdt.internal.compiler.parser.Parser.consumeToken(Parser.java:9012)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:11074)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:11461)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.parseStatements(MethodDeclaration.java:194)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.parseMethods(TypeDeclaration.java:874)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.parse(CompilationUnitResolver.java:550)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1209)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:812)
at processing.mode.java.pdex.PreprocessingService.makeAST(PreprocessingService.java:644)
at processing.mode.java.pdex.PreprocessingService.preprocessSketch(PreprocessingService.java:405)
at processing.mode.java.pdex.PreprocessingService.mainLoop(PreprocessingService.java:130)
at processing.mode.java.pdex.PreprocessingService$$Lambda$27/807528644.run(Unknown Source)
at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-6" java.lang.OutOfMemoryError: Java heap space
at processing.mode.java.preproc.PdeLexer.mWS(PdeLexer.java:475)
at processing.mode.java.preproc.PdeLexer.nextToken(PdeLexer.java:127)
at antlr.TokenStreamHiddenTokenFilter.consume(TokenStreamHiddenTokenFilter.java:38)
at antlr.TokenStreamCopyingHiddenTokenFilter.nextToken(TokenStreamCopyingHiddenTokenFilter.java:165)
at antlr.TokenBuffer.fill(TokenBuffer.java:69)
at antlr.TokenBuffer.LA(TokenBuffer.java:80)
at antlr.LLkParser.LA(LLkParser.java:52)
at processing.mode.java.preproc.PdeRecognizer.unaryExpressionNotPlusMinus(PdeRecognizer.java:7266)
at processing.mode.java.preproc.PdeRecognizer.unaryExpression(PdeRecognizer.java:7125)
at processing.mode.java.preproc.PdeRecognizer.multiplicativeExpression(PdeRecognizer.java:6988)
at processing.mode.java.preproc.PdeRecognizer.additiveExpression(PdeRecognizer.java:6939)
at processing.mode.java.preproc.PdeRecognizer.shiftExpression(PdeRecognizer.java:6882)
at processing.mode.java.preproc.PdeRecognizer.relationalExpression(PdeRecognizer.java:6765)
at processing.mode.java.preproc.PdeRecognizer.equalityExpression(PdeRecognizer.java:6716)
at processing.mode.java.preproc.PdeRecognizer.andExpression(PdeRecognizer.java:6687)
at processing.mode.java.preproc.PdeRecognizer.exclusiveOrExpression(PdeRecognizer.java:6658)
at processing.mode.java.preproc.PdeRecognizer.inclusiveOrExpression(PdeRecognizer.java:6629)
at processing.mode.java.preproc.PdeRecognizer.logicalAndExpression(PdeRecognizer.java:6600)
at processing.mode.java.preproc.PdeRecognizer.logicalOrExpression(PdeRecognizer.java:6571)
at processing.mode.java.preproc.PdeRecognizer.conditionalExpression(PdeRecognizer.java:4209)
at processing.mode.java.preproc.PdeRecognizer.assignmentExpression(PdeRecognizer.java:1974)
at processing.mode.java.preproc.PdeRecognizer.expression(PdeRecognizer.java:1302)
at processing.mode.java.preproc.PdeRecognizer.initializer(PdeRecognizer.java:5743)
at processing.mode.java.preproc.PdeRecognizer.arrayInitializer(PdeRecognizer.java:5821)
at processing.mode.java.preproc.PdeRecognizer.initializer(PdeRecognizer.java:5750)
at processing.mode.java.preproc.PdeRecognizer.arrayInitializer(PdeRecognizer.java:5821)
at processing.mode.java.preproc.PdeRecognizer.initializer(PdeRecognizer.java:5750)
at processing.mode.java.preproc.PdeRecognizer.varInitializer(PdeRecognizer.java:2230)
at processing.mode.java.preproc.PdeRecognizer.variableDeclarator(PdeRecognizer.java:2183)
at processing.mode.java.preproc.PdeRecognizer.variableDefinitions(PdeRecognizer.java:2128)
at processing.mode.java.preproc.PdeRecognizer.declaration(PdeRecognizer.java:3251)
at processing.mode.java.preproc.PdeRecognizer.statement(PdeRecognizer.java:672)
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at java.lang.Object.clone(Native Method)
at sun.java2d.SunGraphics2D.clone(SunGraphics2D.java:309)
at sun.java2d.SunGraphics2D.create(SunGraphics2D.java:343)
at javax.swing.JComponent.paint(JComponent.java:1002)
at javax.swing.JViewport.paint(JViewport.java:728)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1047)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)