MATLAB Answers


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


Log in to comment.

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.


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 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.

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?

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

Log in to comment.

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today