Link to home
Start Free TrialLog in
Avatar of spattewar
spattewar

asked on

Excel crashes while creating a MATLAB Component

Hello Experts,

I am creating an object of a MATLAB component in excel VBA. But when I execute the create object command excel crashes and closes. The error log gives the following description.

*****************************************************
Error occurred during initialization of VM
Could not reserve enough space for object heap
Stack Trace:
  [0] jmi.dll:void __stdcall mwJavaAbort(void)(0x78f95578 "Could not reserve enough space f..", 0, 0x78dd0000, 0x1d8014e0) + 21 bytes

------------------------------------------------------------------------
        Fatal Java Exception detected at Fri Jan 29 11:18:53 2010
------------------------------------------------------------------------

Configuration:
  MATLAB Version:   7.5.0.342 (R2007b)
  MATLAB License:   unknown
  Operating System: Microsoft Windows XP
  Window System:    Version 5.1 (Build 2600: Service Pack 3)
  Processor ID:     x86 Family 6 Model 7 Stepping 10, GenuineIntel
  Virtual Machine:  Java is not enabled
  Default Charset:  windows-1252

Java is not enabled
****************************************************************

It is failing in all the machines in our office in London but is working in our Boston office. We tried to install the latest java and also changed the MATLAB JAVA path as per a working machine in Boston. It was also working on London machine till Last Tuesday and suddenly it started failing on all the machines. We know it is something to do with the machine setting but are not able to figure it out.

The MATLAB runtime is same on all the machines across location and the MATLAB package that we install to get the MATLAB component is also same.

Would you be able to guide me in the correct direction?

Thanks a lot for your time and effort.

$wapnil
Avatar of yuk99
yuk99
Flag of United States of America image

look like the bug is already reported:
http://www.mathworks.com/support/bugreports/425987

ASKER CERTIFIED SOLUTION
Avatar of yuk99
yuk99
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of spattewar

ASKER

Thanks yuk99 and nmcdermaid. I will test these setting tomorrow on the machine that is not working. I will update you with the results.

Thanks for your time on this issue.

$wapnil
So does it work on some machine but not on another?
Spattewar, in future you may wish to add your original question to another group rather than creating a brand new question.

As you can see it's causing some confusion as both questions now only have half the information.

Yuk99, there's a link above to arelated question with some different detail.
I understand nmcdermaid and sorry for the confusion. Next time I will add group to the original question instead of creating one.

Update:
I tried the setting mentioned by nmcdermaid. We created a user environmental variable MATLAB_RESERVE_LO and set its value to 0. But still the same error.

One additional information is that the machine that is not working has MATLAB 2007b runtime package installed and there is no actualy MATLAB software on that machine. Does this make a difference in the approach to tackle the problem?

Now we are trying to again compile the MATLAB dll with -nojvm arguments (if possible), deploy it on the machine and again test it.

Thanks for your time and effort.

$wapnil
Try to compile with -R -nojvm option. Does your application use any Matlab graphics, GUI?
no it does not use any graphics. We will try to compile using that option and test it.

what is the other way to set the nojvm option. I have found a compopts.bat file under the folder C:\Documents and Settings\p462976\Application Data\MathWorks\MATLAB\mcr_v77\ and then under the object folder.

Can we do any configuration changes here?
I believe you can alter this file directly (however I haven't done that myself) or using mbuild -setup command. Take care to use compopts.bat in proper location. See this:
http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/f6-36769.html
You can find preference directory for your Matlab version just running prefdir command.
Users from other locations have replied. It looks like the error was because of other excel add-ins but are not clear on the issue. We tried all the responses and that has of course helped us to narrow down the issue.

Thank you very much for your time and the direction provided.

$wapnil
 
Thank you||