[Ipopt-tickets] [Ipopt] #72: Memory leak detected by Visual Studio 2008

Ipopt coin-trac at coin-or.org
Tue Apr 8 05:21:13 EDT 2008


#72: Memory leak detected by Visual Studio 2008
------------------------------+---------------------------------------------
Reporter:  hmartin            |       Owner:  ipopt-team
    Type:  clarification      |      Status:  new       
Priority:  normal             |   Component:  Ipopt     
 Version:  3.3 (C++ Version)  |    Severity:  normal    
Keywords:                     |  
------------------------------+---------------------------------------------
 Visual Studio has a memory leak detector that can be used in debug mode to
 track malloc/new memory allocations. I activate it most of the time on my
 software. With the current version of Ipopt trunk, a memory leak is
 detected in the file IpMa57TSolverInterface.cpp.

 Basically, it seems the compiler does not release the memory of the two
 arrays of strings ma57_err_msg and ma57_wrn_msg. If I declare explicitly
 the size of the arrays with:
   std::string ma57_err_msg[18] = {" ...
 instead of
   std::string ma57_err_msg[] = {" ...
 no leak is reported.

 I am not sure if it is a real memory leak or a problem/bug in the MS
 runtime, but I think it is worth checking, and anyway easy to correct (for
 instance with an explicit array size, or by using a C++ std::vector
 instead of an array).

-- 
Ticket URL: <https://projects.coin-or.org/Ipopt/ticket/72>
Ipopt <http://projects.coin-or.org/Ipopt>
Interior-point optimizer for nonlinear programs.



More information about the Ipopt-tickets mailing list