Hello Andrew ------------------------------------------------------------ To: Michael Chen <[email protected]> Subject: Re: [Help-glpk] memory not released? Message-ID: <1313210444.2975.1.camel@corvax> From: Andrew Makhorin <[email protected]> Date: Sat, 13 Aug 2011 08:40:44 +0400 ------------------------------------------------------------
>> I used glp_create_job() at beginning and glp_delete_job() at end. >> However, I still get the following warning from valgrind: >> >> ==26789== 160 bytes in 1 blocks are still reachable in loss record 1 of 3 >> ==26789== at 0x4A05E1C: malloc (vg_replace_malloc.c:195) >> ==26789== by 0x422949: glp_init_env (glpenv01.c:62) >> ==26789== by 0x422AA4: _glp_get_env_ptr (glpenv01.c:127) >> ==26789== by 0x4231C0: glp_malloc (glpenv05.c:57) >> ==26789== by 0x41AF2A: glp_create_prob (glpapi01.c:104) >> ==26789== by 0x4144EF: glpkmps (in /home/chensy/working/sppm/src_c/SamplingForTargetCompletionProblemUmbrella/SamplingForTargetCompletionProblemVV2) >> ==26789== by 0x40220D: main (SamplingForTargetCompletionProblemVV2.c:248) >> ==26789== >> >> Does this mean there is a memory leak in glpk implementation? Or I >> misread the output from valgrind? >> > > Please see > http://lists.gnu.org/archive/html/help-glpk/2010-03/msg00092.html This question occurs often enough to make it worth adding: glp_free_env(); /* free ALL memory allocated to GLPK */ to the end of the introductory example in the API manual. best wishes, Robbie --- Robbie Morrison PhD student -- policy-oriented energy system simulation Technical University of Berlin (TU-Berlin), Germany University email (redirected) : [email protected] Webmail (preferred) : [email protected] [from Webmail client] _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk
