[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-glpk] Minor memory leak
From: |
Robbie Morrison |
Subject: |
[Bug-glpk] Minor memory leak |
Date: |
Fri, 8 Jun 2007 05:27:03 +0400 |
Hello GLPK bug list (and Andrew)
It seems that GLPK 4.11 and 4.17 leak a few bytes of
memory each time a problem is built. This may not be a
significant issue, but it is probably worth logging.
The example used was based on sample.c and compiled
using g++.
Lt me know if anyone needs more system, build, and/or
program details.
with best regards
Robbie
--------------------------------------------------------
valgrind output: GLPK 4.11 -- loaded as the (still current) Ubuntu package
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 29 from 1)
malloc/free: in use at exit: 124 bytes in 1 blocks.
malloc/free: 89 allocs, 88 frees, 57,863 bytes allocated.
For counts of detected errors, rerun with: -v
searching for pointers to 1 not-freed blocks.
checked 138,020 bytes.
124 bytes in 1 blocks are still reachable in loss record 1 of 1
at 0x4021396: malloc (vg_replace_malloc.c:149)
by 0x8057EE4: glp_lib_init_env (in
/home/robbie/synk/xeona/svn/futz/glpk-leaktest/sample)
by 0x8057F85: glp_lib_env_ptr (in
/home/robbie/synk/xeona/svn/futz/glpk-leaktest/sample)
by 0x80582C0: glp_lib_umalloc (in
/home/robbie/synk/xeona/svn/futz/glpk-leaktest/sample)
by 0x804B432: glp_lpx_create_prob (in
/home/robbie/synk/xeona/svn/futz/glpk-leaktest/sample)
by 0x8048ABC: main (sample.cc:94)
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks.
possibly lost: 0 bytes in 0 blocks.
still reachable: 124 bytes in 1 blocks.
suppressed: 0 bytes in 0 blocks.
--------------------------------------------------------
valgrind output: GLPK 4.17 -- built from source
$ valgrind --leak-check=yes --show-reachable=yes ./sample
Memcheck, a memory error detector.
Copyright (C) 2002-2006, and GNU GPL'd, by Julian Seward et al.
Using LibVEX rev 1606, a library for dynamic binary translation.
Copyright (C) 2004-2006, and GNU GPL'd, by OpenWorks LLP.
Using valgrind-3.2.0-Debian, a dynamic binary instrumentation framework.
Copyright (C) 2000-2006, and GNU GPL'd, by Julian Seward et al.
For more details, rerun with: -v
dmp_create_pool: warning: debug mode enabled
* 0: objval = 0.000000000e+00 infeas = 0.000000000e+00 (0)
* 2: objval = 7.333333333e+02 infeas = 0.000000000e+00 (0)
OPTIMAL SOLUTION FOUND
z = 733.333; x1 = 33.3333; x2 = 66.6667; x3 = 0
ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1)
malloc/free: in use at exit: 136 bytes in 1 blocks.
malloc/free: 81 allocs, 80 frees, 34,529 bytes allocated.
For counts of detected errors, rerun with: -v
searching for pointers to 1 not-freed blocks.
checked 101,212 bytes.
136 bytes in 1 blocks are still reachable in loss record 1 of 1
at 0x4021396: malloc (vg_replace_malloc.c:149)
by 0x80647F4: _glp_lib_init_env (glplib04.c:68)
by 0x80648F5: _glp_lib_link_env (glplib04.c:116)
by 0x8056550: _glp_lib_xmalloc (glplib06.c:52)
by 0x8053592: glp_create_prob (glpapi01.c:61)
by 0x80489CC: main (sample.cc:95)
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks.
possibly lost: 0 bytes in 0 blocks.
still reachable: 136 bytes in 1 blocks.
suppressed: 0 bytes in 0 blocks.
--------------------------------------------------------
build commands for the 4.17 version:
(noting that 'binary' and 'sources' are my custom makefile variables):
$ make CPPFLAGS="" CXXFLAGS="-Wall -ggdb -O0 -fno-inline" \
binary="sample" sources="sample.cc" \
LDLIBS="/home/robbie/synk/xeona/code_glpk/glpk-4.17/temp/lib/libglpk.a"
all
makefile: sample.cc
makefile: executing fastdep # 'fastdep' creates dependencies
on-the-fly
makefile: building objects
g++ -Wall -ggdb -O0 -fno-inline -c -o sample.o sample.cc
makefile: linking binary: sample
g++ -o sample sample.o
/home/robbie/synk/xeona/code_glpk/glpk-4.17/temp/lib/libglpk.a
makefile: completion of makefile target: all
--------------------------------------------------------
---
Robbie Morrison
PhD student -- policy-oriented energy system simulation
Institute for Energy Engineering (IET)
Technical University of Berlin (TU-Berlin), Germany
University email (redirected) : address@hidden
Webmail (preferred) : address@hidden
[from IMAP client]
- [Bug-glpk] Minor memory leak,
Robbie Morrison <=