Topic
  • 8 replies
  • Latest Post - ‏2013-01-08T23:48:11Z by SystemAdmin
YongCheng@TUDarmstadt
22 Posts

Pinned topic CPLEX 12.4 Memory Leak, a Known issue???

‏2012-05-12T15:45:59Z |
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
Updated on 2013-01-08T23:48:11Z at 2013-01-08T23:48:11Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: CPLEX 12.4 Memory Leak, a Known issue???

    ‏2012-05-13T13: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.
  • YongCheng@TUDarmstadt
    22 Posts

    Re: CPLEX 12.4 Memory Leak, a Known issue???

    ‏2012-05-13T19:07:22Z  
    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.
    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 for-loop 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 64-bit, Vista 32-bit, and Linux 32-bit systems. I got the memory leak problem for all the cases.

    Yong
  • YongCheng@TUDarmstadt
    22 Posts

    Re: CPLEX 12.4 Memory Leak, a Known issue???

    ‏2012-05-13T19:11:21Z  
    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.
    I also tried memory emphasis. It does not help either.
    Yong
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: CPLEX 12.4 Memory Leak, a Known issue???

    ‏2012-05-13T20:08:26Z  
    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 for-loop 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 64-bit, Vista 32-bit, and Linux 32-bit systems. I got the memory leak problem for all the cases.

    Yong
    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?
  • YongCheng@TUDarmstadt
    22 Posts

    Re: CPLEX 12.4 Memory Leak, a Known issue???

    ‏2012-05-14T07:40:39Z  
    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?
    Thank you, Daniel.

    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 MI-SOCP 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
  • YongCheng@TUDarmstadt
    22 Posts

    Re: CPLEX 12.4 Memory Leak, a Known issue???

    ‏2012-05-14T09:05:06Z  
    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?
    Thank you, Daniel Junglas.

    I sent you my codes by email. I am looking forward to your response.

    Yong
  • YongCheng@TUDarmstadt
    22 Posts

    Re: CPLEX 12.4 Memory Leak, a Known issue???

    ‏2012-05-15T10:26:52Z  
    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?
    Dear All,

    One more piece of information:

    I create a global CPLEX object in MATLAB. When I try to change cplex.Model in different sub-programs 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
  • SystemAdmin
    SystemAdmin
    7929 Posts

    Re: CPLEX 12.4 Memory Leak, a Known issue???

    ‏2013-01-08T23:48:11Z  
    Dear All,

    One more piece of information:

    I create a global CPLEX object in MATLAB. When I try to change cplex.Model in different sub-programs 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
    I'm having the same problem. Is there a fix or work around for this issue?