Why do I receive an "Unable to start the JVM" error when trying to use my MATLAB Builder EX Add-in or MATLAB Builder NE COM Object in Excel?

10 次查看(过去 30 天)
Upon creating an object instance of my MATLAB Builder EX Add-in or MATLAB Builder NE Object in VBA in Excel I receive the following error:
Unable to start the JVM.
Error occurred during initialization of VM
Could not reserve enough space for object heap
After clicking OK Excel may exit.

采纳的回答

MathWorks Support Team
When you are working with a MATLAB Builder EX or NE component in Excel, the MATLAB Compiler Runtime (MCR) must be loaded into the memory space of Excel. This memory space is also shared with (other) Excel Add-ins. If these other Add-ins are using too much memory already or if they have fragmented the Excel memory too much, the MCR will not be able to fully load and display the error given above.
First of all please double check your "Java Heap Memory" settings under "General" in the "Preferences" of the MATLAB installation used to compile the component. If this is set to anything other than the minimum value, try setting it to the minimum value. Then verify that your code still runs in MATLAB. If so recompile the component and try using this new component in Excel again. If this does not resolve the issue try one of the other options below.
Alternatively, try disabling other Add-ins in Excel. When doing so please make sure to check both the "Excel Add-ins" and the "COM Add-ins". So you basically need to go to "Excel Options" and then "Add-ins" twice. Where the first time you select "Excel Add-ins" and the second time choose "COM Add-ins" from the dropdown:
Another solution could be to try to disable the JVM (see the "Advanced" tab of your DEPLOYTOOL project settings). Note this will only work if your code does not depend on any Java functionality in MATLAB; to verify this you can try running your code in a MATLAB session started with the -nojvm option.
Lastly if you are on Windows XP and are using MATLAB Builder EX (R2012b), you can try deleting the file named nativewebproxy.dll from your MATLAB/MCR bin\win32 directory. Removing this DLL will not hinder any MATLAB functionality but will may reduce memory fragmentation.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Export to MATLAB 的更多信息

标签

尚未输入任何标签。

产品


版本

R2012a

Community Treasure Hunt

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

Start Hunting!

Translated by