Dear All,
I'm using CPLEX 12.4 academic version (no license requirement) with MATLAB2010a on a Linux 32bit PC. I get the memory leak problem.
I found the following related thread:
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=330228
It seems that the memory leak problem was a known issue for CPLEX academic versions.
Does CPLEX 12.4 academic version still have this problem???
Thanks.
Yong
Topic

Re: CPLEX 12.4 Memory Leak, a Known issue???
20120513T13:27:30ZThis is the accepted answer. This is the accepted answer.The memory leak described in the thread you quoted (and which could be worked around by setting environment variable MKL_DISABLE_FAST_MM to 1) is fixed in CPLEX 12.4.
If you still observe a memory leak then this is something different. I guess it does not help to set MKL_DISABLE_FAST_MM, right?
Could you give us more details about the leak you observe? Maybe even post some code here that reproduces the leak? Or send such code to me: daniel(dot)junglas(at)de(dot)ibm(dot)com. 
Re: CPLEX 12.4 Memory Leak, a Known issue???
20120513T19:07:22ZThis is the accepted answer. This is the accepted answer. SystemAdmin
 20120513T13:27:30Z
The memory leak described in the thread you quoted (and which could be worked around by setting environment variable MKL_DISABLE_FAST_MM to 1) is fixed in CPLEX 12.4.
If you still observe a memory leak then this is something different. I guess it does not help to set MKL_DISABLE_FAST_MM, right?
Could you give us more details about the leak you observe? Maybe even post some code here that reproduces the leak? Or send such code to me: daniel(dot)junglas(at)de(dot)ibm(dot)com.
However, I cannot post my program here because it requires supporting data and files to run.
You are right. Setting MKL_DISABLE_FAST_MM to 1 does not help. Even setting the number of threads to 1 does not help.
In my program, I need to solve a SOCP many times in a forloop in MATLAB. I creat one global Cplex object and modify the model and call cplex.solve() in each iteration.
For my understanding, the memory used by CPLEX is not freed after solving a SOCP in each iteration. As a result, the memory used by MATLAB is accumulating and growing, which eventually leads to "out of memory" error.
I also tried CPLEX MATLAB toolbox functions. I got the same memory leak problem.
I use CPLEX 12.4 academic version, without license requirement. I try it on Win7 64bit, Vista 32bit, and Linux 32bit systems. I got the memory leak problem for all the cases.
Yong 
Re: CPLEX 12.4 Memory Leak, a Known issue???
20120513T19:11:21ZThis is the accepted answer. This is the accepted answer. SystemAdmin
 20120513T13:27:30Z
The memory leak described in the thread you quoted (and which could be worked around by setting environment variable MKL_DISABLE_FAST_MM to 1) is fixed in CPLEX 12.4.
If you still observe a memory leak then this is something different. I guess it does not help to set MKL_DISABLE_FAST_MM, right?
Could you give us more details about the leak you observe? Maybe even post some code here that reproduces the leak? Or send such code to me: daniel(dot)junglas(at)de(dot)ibm(dot)com.
Yong 
Re: CPLEX 12.4 Memory Leak, a Known issue???
20120513T20:08:26ZThis is the accepted answer. This is the accepted answer. YongCheng@TUDarmstadt
 20120513T19:07:22Z
Thank you, Daniel.
However, I cannot post my program here because it requires supporting data and files to run.
You are right. Setting MKL_DISABLE_FAST_MM to 1 does not help. Even setting the number of threads to 1 does not help.
In my program, I need to solve a SOCP many times in a forloop in MATLAB. I creat one global Cplex object and modify the model and call cplex.solve() in each iteration.
For my understanding, the memory used by CPLEX is not freed after solving a SOCP in each iteration. As a result, the memory used by MATLAB is accumulating and growing, which eventually leads to "out of memory" error.
I also tried CPLEX MATLAB toolbox functions. I got the same memory leak problem.
I use CPLEX 12.4 academic version, without license requirement. I try it on Win7 64bit, Vista 32bit, and Linux 32bit systems. I got the memory leak problem for all the cases.
Yong
Could you give us more details about the model you start with and the way in which you modify it in each loop?
The model you start with is a pure SOCP, correct?
What modifications do you perform in the loop? Do you add constraints, change variable bounds, change coefficients in constraints? Is the problem still an SOCP after your modifications? What are the matlab statements you use to modify the problem?
Would it be easy to change your code so that it creates the model from scratch in each iteration? If that is easy to do, could you give that a try and see if you are still leaking memory? 
Re: CPLEX 12.4 Memory Leak, a Known issue???
20120514T07:40:39ZThis is the accepted answer. This is the accepted answer. SystemAdmin
 20120513T20:08:26Z
OK, we need to try to reproduce that here.
Could you give us more details about the model you start with and the way in which you modify it in each loop?
The model you start with is a pure SOCP, correct?
What modifications do you perform in the loop? Do you add constraints, change variable bounds, change coefficients in constraints? Is the problem still an SOCP after your modifications? What are the matlab statements you use to modify the problem?
Would it be easy to change your code so that it creates the model from scratch in each iteration? If that is easy to do, could you give that a try and see if you are still leaking memory?
Yes, I always have pure SOCP in each iteration. And in each iteration, I need to change the constraints, and change the bounds, etc.
I also tried building the model from scratch in each iteration. However, it does not help.
I will build a toy example from my codes and send it to you by email.
By the way, it seems that solving MISOCP does not lead to memory leak issue. Anyway, I will play with my codes more and provide you with more details.
Once again, thank you very much for your attention.
Yong 
Re: CPLEX 12.4 Memory Leak, a Known issue???
20120514T09:05:06ZThis is the accepted answer. This is the accepted answer. SystemAdmin
 20120513T20:08:26Z
OK, we need to try to reproduce that here.
Could you give us more details about the model you start with and the way in which you modify it in each loop?
The model you start with is a pure SOCP, correct?
What modifications do you perform in the loop? Do you add constraints, change variable bounds, change coefficients in constraints? Is the problem still an SOCP after your modifications? What are the matlab statements you use to modify the problem?
Would it be easy to change your code so that it creates the model from scratch in each iteration? If that is easy to do, could you give that a try and see if you are still leaking memory?
I sent you my codes by email. I am looking forward to your response.
Yong 
Re: CPLEX 12.4 Memory Leak, a Known issue???
20120515T10:26:52ZThis is the accepted answer. This is the accepted answer. SystemAdmin
 20120513T20:08:26Z
OK, we need to try to reproduce that here.
Could you give us more details about the model you start with and the way in which you modify it in each loop?
The model you start with is a pure SOCP, correct?
What modifications do you perform in the loop? Do you add constraints, change variable bounds, change coefficients in constraints? Is the problem still an SOCP after your modifications? What are the matlab statements you use to modify the problem?
Would it be easy to change your code so that it creates the model from scratch in each iteration? If that is easy to do, could you give that a try and see if you are still leaking memory?
One more piece of information:
I create a global CPLEX object in MATLAB. When I try to change cplex.Model in different subprograms with different problem sizes, I get the error:
??? Error using ==> cplexlink124
length not equal
In short, when I have one global CPLEX object, I cannot use it to model and solve a problem with 200 variables and another problem with 300 variables, even if I clear everying except the global CPLEX object after each modeling.
It seems to me that there is aways a copy of the CPLEX object inside. And you can not change cplex.Model to model different problems (e.g., adding more variables to the model) with one global CPLEX object. I think this is related to Memory leak.
Yong 
Re: CPLEX 12.4 Memory Leak, a Known issue???
20130108T23:48:11ZThis is the accepted answer. This is the accepted answer. YongCheng@TUDarmstadt
 20120515T10:26:52Z
Dear All,
One more piece of information:
I create a global CPLEX object in MATLAB. When I try to change cplex.Model in different subprograms with different problem sizes, I get the error:
??? Error using ==> cplexlink124
length not equal
In short, when I have one global CPLEX object, I cannot use it to model and solve a problem with 200 variables and another problem with 300 variables, even if I clear everying except the global CPLEX object after each modeling.
It seems to me that there is aways a copy of the CPLEX object inside. And you can not change cplex.Model to model different problems (e.g., adding more variables to the model) with one global CPLEX object. I think this is related to Memory leak.
Yong