Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

out of memory error in matlab fuzzy system running with java

Asked by Jian Dong on 7 Jan 2013

Hi I have developed a fuzzy model in Matlab and converted in to Java package through Matlab builder JA. The fuzzy system takes four inputs and give one output. all inputs and output are numbers (type double). I am running this fuzzy system in java environment where inputs are generated with another java module.I am getting results when I just run a small loop like only 256 ( that means I am giving 4 inputs 256 times and get one output 256 time in single run).However, If I run the same model with 512 or 1024 times then It does not go through and middle of the program it is mentioned "out of memory error". Please note that I am running this model on high performance machine with 300 GB RAM.I follow the Matlab tutorial to convert the Matlab fuzzy model into java where I have also used dispose method. Could anyone give the reason why fuzzy is taken too much memory and how can I reduce the memory usage? your help in this regard would highly be appreciated

0 Comments

Jian Dong

1 Answer

Answer by Ryan G on 7 Jan 2013

If you're running this on Java only, it's not really a MATLAB question. However, to debug an issue like this one thing you can do is run test inputs through the Fuzzy system in MATLAB and see if there are any issues.

It sounds like there is a memory leak in your program and that may or may not involve the fuzzy system. It is important you determine whether or not it is the cause.

3 Comments

Jian Dong on 8 Jan 2013

Thanks for your reply, it happens when I add fuzzy model in my program. it is noticed that without fuzzy model there is no such issue. For my clarification, I have run only Matalb fuzzy converted model in java by giving input through simple "for loop". it means now program contains fuzzy converted model and "for loop") and run in java. I noticed that each iterator of "for loop" takes 100 MB of RAM. if i run 512 time then 51200 MB RAM would be required.so Now my question is how come Matlab converted fuzzy model takes too much memory and what is the way how it can be reduced. your answer would highly be appreciated.

Ryan G on 8 Jan 2013

Is the for-loop running in MATLAB or Java? Would it be possible to remove the for loop from the MATLAB code and instead write that portion in Java directly?

Jian Dong on 14 Jan 2013

for -loop is running in Java. In matlab, there is only 3 lines code just calling .fis file where I have created fuzzy.

Ryan G

Contact us