Java Heap error

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Java Heap error

3,152 次查看
juliancox
Contributor V

I am running CW 11.1 under Windows 7 64bit with a S08QE12 project.

I have several projects in the workspace and they all compile, build and debug using my Multilink Universal FX. That is  - all except one, which always gives an out of memory error (Java heap space, which it tells me is set at 512MB). If I cancel the error windows and decline to close CW it eventually builds (VERY SLOWLY) and debugs. I have re-installed CW and Windows, but it makes no difference. My workspace is on a cloud drive and so I tried it on another computer (my laptop) and it works fine.

 

0 项奖励
回复
3 回复数

327 次查看
rakeshjogi
Contributor I

The error java.lang.OutOfMemoryError: Java heap space usually indicates to us that the application is exhausted with the allocated memory in the Java heap. This is caused by objects not being fully released between tests. You can try to increase the heap size using JVM options such as -Xms and -Xmx.  Verify the behavior after increasing memory. If the issue still persists, then it could be most likely caused by excessive object allocation or a memory leak in the application.

Here the CodeWarrior (CW) is running out of memory while building that particular project. I understand that the IDE is currently set to use 512MB of Java heap memory. But for this specific project, that amount seems not to be enough. So simply because of this out-of-memory error occurs here. When such an error occurs, obviously the build will be slow. As the project eventually builds after you cancel the error messages, it shows that memory is tight but not completely failing. So if you increase the heap size or run the workspace locally, either of these should resolve the problem. If you are interested in learning about the types of OutOfMemoryError, you can check out this blog: Types of OutOfMemoryError, Causes, and Solutions. Also, You can check out this blog How to Solve OutOfMemoryError: Java heap space to understand more about this Java Heap Space error.

0 项奖励
回复

3,091 次查看
juliancox
Contributor V

Sorry for the delay in answering.

I saved all of the source files as text and then deleted the project. I then created a new project and copied-in all of the source files. Now it works fine.

F.Y.I. For the last eight years i have been using i-Cloud storage and running CW under Windows 7 as a Virtual Machine on an i-Mac - all without problems. It also runs faster than if I use a native PC (which i have tried).

0 项奖励
回复

3,139 次查看
vicentegomez
NXP TechSupport
NXP TechSupport

 

Hi We do not recommend that you use a cloud workspace,

 

can you please make a test using a local workspace?

 

Regards

Vicente 

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1342521%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EJava%20%E5%A0%86%E9%94%99%E8%AF%AF%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1342521%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E5%9C%A8%20Windows%207%2064bit%20%E4%B8%8B%E8%BF%90%E8%A1%8C%20CW%2011.1%EF%BC%8C%E9%A1%B9%E7%9B%AE%E4%B8%BA%20S08QE12%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E7%9A%84%E5%B7%A5%E4%BD%9C%E7%A9%BA%E9%97%B4%E4%B8%AD%E6%9C%89%E5%87%A0%E4%B8%AA%E9%A1%B9%E7%9B%AE%EF%BC%8C%E5%AE%83%E4%BB%AC%E9%83%BD%E4%BD%BF%E7%94%A8%E6%88%91%E7%9A%84%20Multilink%20Universal%20FX%20%E8%BF%9B%E8%A1%8C%E7%BC%96%E8%AF%91%E3%80%81%E7%89%88%E6%9C%AC%E5%92%8C%E8%B0%83%E8%AF%95%E3%80%82%E4%B9%9F%E5%B0%B1%E6%98%AF%E8%AF%B4%EF%BC%8C%E9%99%A4%E4%BA%86%E4%B8%80%E4%B8%AA%E6%80%BB%E6%98%AF%E5%87%BA%E7%8E%B0%E5%86%85%E5%AD%98%E4%B8%8D%E8%B6%B3%E9%94%99%E8%AF%AF%EF%BC%88Java%20%E5%A0%86%E7%A9%BA%E9%97%B4%EF%BC%8C%E5%AE%83%E5%91%8A%E8%AF%89%E6%88%91%E8%AE%BE%E7%BD%AE%E4%B8%BA%20512MB%EF%BC%89%E7%9A%84%E7%A8%8B%E5%BA%8F%E3%80%82%E5%A6%82%E6%9E%9C%E6%88%91%E5%8F%96%E6%B6%88%E9%94%99%E8%AF%AF%E7%AA%97%E5%8F%A3%E5%B9%B6%E6%8B%92%E7%BB%9D%E5%85%B3%E9%97%AD%20CW%EF%BC%8C%E5%AE%83%E6%9C%80%E7%BB%88%E4%BC%9A%E7%89%88%E6%9C%AC%EF%BC%88%E9%9D%9E%E5%B8%B8%E7%BC%93%E6%85%A2%EF%BC%89%E5%92%8C%E8%B0%83%E8%AF%95%E3%80%82%E6%88%91%E9%87%8D%E6%96%B0%E5%AE%89%E8%A3%85%E4%BA%86%20CW%20%E5%92%8C%20Windows%EF%BC%8C%E4%BD%86%E6%B2%A1%E6%9C%89%E4%BB%BB%E4%BD%95%E5%8C%BA%E5%88%AB%E3%80%82%E6%88%91%E7%9A%84%E5%B7%A5%E4%BD%9C%E5%8C%BA%E5%9C%A8%E4%BA%91%E9%A9%B1%E5%8A%A8%E5%99%A8%E4%B8%8A%EF%BC%8C%E5%9B%A0%E6%AD%A4%E6%88%91%E5%9C%A8%E5%8F%A6%E4%B8%80%E5%8F%B0%E7%94%B5%E8%84%91%EF%BC%88%E6%88%91%E7%9A%84%E7%AC%94%E8%AE%B0%E6%9C%AC%E7%94%B5%E8%84%91%EF%BC%89%E4%B8%8A%E8%BF%9B%E8%A1%8C%E4%BA%86%E5%B0%9D%E8%AF%95%EF%BC%8C%E7%BB%93%E6%9E%9C%E8%BF%90%E8%A1%8C%E6%AD%A3%E5%B8%B8%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2321344%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Java%20Heap%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2321344%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%E9%94%99%E8%AF%AF%3C%2FSPAN%3E%20%3CA%20href%3D%22https%3A%2F%2Fblog.heaphero.io%2Fjava-outofmemoryerror-heap-space%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%3CSPAN%3Ejava.lang.outofMemoryError%3A%20Java%20%E5%A0%86%E7%A9%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C%80%E7%BB%88%E4%BC%9A%E7%89%88%E6%9C%AC%EF%BC%8C%E8%BF%99%E8%A1%A8%E6%98%8E%E5%86%85%E5%AD%98%E7%B4%A7%E5%BC%A0%E4%BD%86%E5%B9%B6%E6%9C%AA%E5%AE%8C%E5%85%A8%E5%A4%B1%E6%95%88%E3%80%82%E5%9B%A0%E6%AD%A4%EF%BC%8C%E5%A6%82%E6%9E%9C%E4%BD%A0%E5%A2%9E%E5%8A%A0%E5%A0%86%E5%A4%A7%E5%B0%8F%E6%88%96%E5%9C%A8%E6%9C%AC%E5%9C%B0%E8%BF%90%E8%A1%8C%E5%B7%A5%E4%BD%9C%E7%A9%BA%E9%97%B4%EF%BC%8C%E8%BF%99%E4%B8%A4%E7%A7%8D%E6%96%B9%E6%B3%95%E9%83%BD%E5%BA%94%E8%AF%A5%E5%8F%AF%E4%BB%A5%E8%A7%A3%E5%86%B3%E9%97%AE%E9%A2%98%E3%80%82%E5%A6%82%E6%9E%9C%E4%BD%A0%E6%9C%89%E5%85%B4%E8%B6%A3%E4%BA%86%E8%A7%A3%20OutofMemoryError%20%E7%9A%84%E7%B1%BB%E5%9E%8B%EF%BC%8C%E5%8F%AF%E4%BB%A5%E7%9C%8B%E7%9C%8B%E8%BF%99%E4%B8%AA%E5%8D%9A%E5%AE%A2%EF%BC%9AOutofMemoryEr%20%3CA%20href%3D%22https%3A%2F%2Fblog.heaphero.io%2Ftypes-of-outofmemoryerror%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%3CSPAN%3Eror%20%E7%9A%84%E7%B1%BB%E5%9E%8B%E3%80%81%E5%8E%9F%E5%9B%A0%E5%92%8C%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%3C%2FSPAN%3E%3C%2FA%3E%3CSPAN%3E%E3%80%82%E5%8F%A6%E5%A4%96%EF%BC%8C%E4%BD%A0%E5%8F%AF%E4%BB%A5%E6%9F%A5%E7%9C%8B%E8%BF%99%E7%AF%87%E5%8D%9A%E5%AE%A2%3C%2FSPAN%3E%E3%80%8A%3CA%20href%3D%22https%3A%2F%2Fblog.heaphero.io%2Fjava-outofmemoryerror-heap-space%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3E%3CSPAN%3E%3C%2FSPAN%3E%3C%2FA%3E%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3%E5%86%85%E5%AD%98%E4%B8%8D%E8%B6%B3%E9%94%99%E8%AF%AF%EF%BC%9AJava%20%E5%A0%86%E7%A9%BA%E9%97%B4%E3%80%8B%EF%BC%8C%3CSPAN%3E%E8%BF%9B%E4%B8%80%E6%AD%A5%E4%BA%86%E8%A7%A3%E8%BF%99%E4%B8%AA%3C%2FSPAN%3E%20Java%20%E5%A0%86%E7%A9%BA%E9%97%B4%E9%94%99%E8%AF%AF%E3%80%82%3CSPAN%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1350657%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Java%20Heap%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1350657%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%BE%88%E6%8A%B1%E6%AD%89%E5%BB%B6%E8%BF%9F%E7%AD%94%E5%A4%8D%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E5%B0%86%E6%89%80%E6%9C%89%E6%BA%90%E6%96%87%E4%BB%B6%E4%BF%9D%E5%AD%98%E4%B8%BA%E6%96%87%E6%9C%AC%E6%96%87%E4%BB%B6%EF%BC%8C%E7%84%B6%E5%90%8E%E5%88%A0%E9%99%A4%E4%BA%86%E9%A1%B9%E7%9B%AE%E3%80%82%E7%84%B6%E5%90%8E%EF%BC%8C%E6%88%91%E5%88%9B%E5%BB%BA%E4%BA%86%E4%B8%80%E4%B8%AA%E6%96%B0%E9%A1%B9%E7%9B%AE%EF%BC%8C%E5%B9%B6%E5%A4%8D%E5%88%B6%E4%BA%86%E6%89%80%E6%9C%89%E6%BA%90%E6%96%87%E4%BB%B6%E3%80%82%E7%8E%B0%E5%9C%A8%E8%BF%90%E8%A1%8C%E6%AD%A3%E5%B8%B8%E3%80%82%3C%2FP%3E%3CP%3EF.Y.I.%E5%9C%A8%E8%BF%87%E5%8E%BB%E7%9A%84%E5%85%AB%E5%B9%B4%E9%87%8C%EF%BC%8C%E6%88%91%E4%B8%80%E7%9B%B4%E5%9C%A8%E4%BD%BF%E7%94%A8%20i-Cloud%20%E5%AD%98%E5%82%A8%EF%BC%8C%E5%B9%B6%E5%9C%A8%20Windows%207%20%E4%B8%8B%E5%B0%86%20CW%20%E4%BD%9C%E4%B8%BA%E8%99%9A%E6%8B%9F%E6%9C%BA%E5%9C%A8%20i-Mac%20%E4%B8%8A%E8%BF%90%E8%A1%8C%EF%BC%8C%E6%89%80%E6%9C%89%E8%BF%99%E4%BA%9B%E9%83%BD%E6%B2%A1%E6%9C%89%E5%87%BA%E7%8E%B0%E8%BF%87%E9%97%AE%E9%A2%98%E3%80%82%E5%AE%83%E7%9A%84%E8%BF%90%E8%A1%8C%E9%80%9F%E5%BA%A6%E4%B9%9F%E6%AF%94%E6%88%91%E4%BD%BF%E7%94%A8%E6%9C%AC%E5%9C%B0%20PC%EF%BC%88%E6%88%91%E8%AF%95%E8%BF%87%EF%BC%89%E5%BF%AB%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1344441%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Java%20Heap%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1344441%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBR%20%2F%3E%3CP%3E%E4%BD%A0%E5%A5%BD%EF%BC%8C%E6%88%91%E4%BB%AC%E4%B8%8D%E5%BB%BA%E8%AE%AE%E6%82%A8%E4%BD%BF%E7%94%A8%E4%BA%91%E5%B7%A5%E4%BD%9C%E5%8C%BA%E3%80%81%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E8%AF%B7%E4%BD%BF%E7%94%A8%E6%9C%AC%E5%9C%B0%E5%B7%A5%E4%BD%9C%E5%8C%BA%E8%BF%9B%E8%A1%8C%E6%B5%8B%E8%AF%95%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E6%AD%A4%E8%87%B4%3C%2FP%3E%3CP%3E%E7%BB%B4%E6%A3%AE%E7%89%B9%20%3C%2FP%3E%3C%2FLINGO-BODY%3E