Crah problem , matlab not working

hi , every time i open matlab , it windown gets stuck on not responding and alsp gets these errors Pls find the attchmnent
pls give me solution for it, as i have already un install in re installed still facing the issue

7 Comments

It seems like you do not have a working MATLAB license key.
No , i have MATLAB license key
The No Available License Keys message might be caused by Java having run out of memory -- the problem might not be the license keys but rather something leading up to the point of validating the license keys.
I do not have any suggestions at the moment as why Java might be running out of memory. Have you configured your own Java version, or are you relying on the default java version ?
One thing you could try is removing any directory C:\Users\YOURUSERNAME\AppData\Roaming\MathWorks\MATLAB\R2021a and then starting MATLAB again. That is the preferences directory; if you had corrupt preferences then that is something that might last through repeated installation.
i have also increased the java heap memory but still getting the same error.
will try changing the preference directory , hope it works
should i delete this C:\Users\YOURUSERNAME\AppData\Roaming\MathWorks\MATLAB\R2021a
i have changed the preference but still getting this error
Warning: A Java exception occurred trying to load the LiveAppManager/getAppContainer class:
Java exception occurred:
java.lang.OutOfMemoryError: GC overhead limit exceeded
> In connector.internal.fevalMatlab
In connector.internal.fevalJSON
Warning: A Java exception occurred trying to load the
matlab/internal/editor/LiveTaskUtilities/generateScript class:
Java exception occurred:
java.lang.OutOfMemoryError: GC overhead limit exceeded
> In connector.internal.fevalMatlab
In connector.internal.fevalJSON
Warning: A Java exception occurred trying to load the
matlab/internal/editor/LiveTaskUtilities/generateSummary class:
Java exception occurred:
java.lang.OutOfMemoryError: GC overhead limit exceeded
> In connector.internal.fevalMatlab
In connector.internal.fevalJSON
Warning: A Java exception occurred trying to load the
matlab/internal/editor/LiveAppManager/CHANGED_REQUEST_CHANNEL class:
Java exception occurred:
java.lang.OutOfMemoryError: GC overhead limit exceeded
> In connector.internal.fevalMatlab
In connector.internal.fevalJSON
Warning: A Java exception occurred trying to load the LiveTaskUtilities/reset class:
Java exception occurred:
java.lang.OutOfMemoryError: GC overhead limit exceeded
> In connector.internal.fevalMatlab
In connector.internal.fevalJSON
Warning: A Java exception occurred trying to load the matlab/internal/editor/LiveAppManager/getFigure
class:
Java exception occurred:
java.lang.OutOfMemoryError: GC overhead limit exceeded
> In connector.internal.fevalMatlab
In connector.internal.fevalJSON
Exception in thread "AWT-EventQueue-0": java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.mathworks.widgets.BusyAffordance.paintEachDot(BusyAffordance.java:413)
at com.mathworks.widgets.BusyAffordance.paintDots(BusyAffordance.java:383)
at com.mathworks.widgets.BusyAffordance.paintAffordance(BusyAffordance.java:366)
at com.mathworks.widgets.BusyAffordance$1.paintComponent(BusyAffordance.java:206)
at javax.swing.JComponent.paint(JComponent.java:1056)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
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)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
Exception in thread "AWT-EventQueue-0": java.lang.OutOfMemoryError: GC overhead limit exceeded
Exception in thread "Explorer NavigationContext request queue": java.lang.OutOfMemoryError: GC overhead limit exceeded
Exception in thread "AWT-EventQueue-0": java.lang.OutOfMemoryError: GC overhead limit exceeded
Exception in thread "AWT-EventQueue-0": java.lang.OutOfMemoryError: GC overhead limit exceeded
>>
You might need to increase the Java Heap Memory https://www.mathworks.com/help/matlab/matlab_external/java-heap-memory-preferences.html -- but if you are receiving the error as soon as you open MATLAB then changing the heap size might not help.
Do you happen to have a startup.m in your path that might be running some function ?
no i cannot find any startup.m file in path

Sign in to comment.

Answers (1)

Hi Shikha,
This error can occur when the Java Garbage Collector has exceeded its overhead limit.
You can eliminate this error by following the workarounds mentioned below:
1. To disable the overhead limit, add the following line to the java.opts file:
-XX:-UseGCOverheadLimit
If a java.opts file already exists on your MATLAB path, add the above-mentioned line to this file. If the file does not currently exist on your machine, please create a text file called java.opts and place this file in the location:
$MATLABROOT/bin/$ARCH
where $MATLABROOT is the MATLAB root directory obtained by typing the following at the MATLAB Command Prompt:
matlabroot
and $ARCH is the output of typing the following at the MATLAB Command Prompt:
computer('arch')
2. One may force more Java garbage collection from the command line as well:-
r = java.lang.Runtime.getRuntime();
r.gc;
r.gc;
r.gc;
Running r.gc only once may not activate the object method and hence may need to be used more number of times.
Hope this helps!!

Categories

Products

Release

R2021a

Asked:

on 3 Oct 2022

Answered:

on 20 Feb 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!