Subject: CGAL users discussion list
List archive
- From: Marc Glisse <>
- To: cgal-discuss <>
- Subject: Re: [cgal-discuss] Memory leak when using Polyhedron_3<EPECK>
- Date: Wed, 17 Feb 2016 10:10:09 +0100 (CET)
On Wed, 17 Feb 2016, Benjamin Kehlet wrote:
I am struggling with memory leaks when doing some simple manipulations of
the geomtric locations of the vertices of a Polyhedron_3 when using the
EPECK kernel.
Attached is the simplest example that reproduces the issue I could come up
with. It is an implementation of a very simple smoothing scheme, which just
replaces the location of every vertex with the centroid of its neighbors.
The implementation does two passes: In the first pass the new locations are
computed and collected in an std::vector<std::pair<Vertex_handle,
Point_3>>. Then in the second pass the new locations are applied. This
leaks heavily and the consumed memory (simply monitored with top) increases
by each smoothing iteration.
What makes you say that it leaks? Epeck is lazy, it stores the tree of operations that led each object to its current value, with an approximate version of the object. It only drops that tree when something calls exact() on an object (usually because the approximate object was not precise enough to determine the result of a predicate). So it is normal that the size increases. You can disable that lazy behavior (look for macros in the header that defines Epeck), but the running time will increase since all constructions will be done eagerly with an exact NT.
Another strange thing is that when running "valgrind --tool=memcheck", I
get this error
"""
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: -CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1)
File:
/home/benjamik/software/CGAL-4.8-beta1/local/include/CGAL/Interval_nt.h
Line: 209
Explanation: Wrong rounding: did you forget the -frounding-math option if
you use GCC (or -fp-model strict for Intel)?
"""
which doesn't show up when I just run the program (with a debug
configuration of CGAL).
valgrind does not support floating point rounding modes, old issue. I wish this were a warning instead of a hard error though.
--
Marc Glisse
- [cgal-discuss] Memory leak when using Polyhedron_3<EPECK>, Benjamin Kehlet, 02/17/2016
- Re: [cgal-discuss] Memory leak when using Polyhedron_3<EPECK>, Marc Glisse, 02/17/2016
- Re: [cgal-discuss] Memory leak when using Polyhedron_3<EPECK>, Benjamin Kehlet, 02/18/2016
- Re: [cgal-discuss] Memory leak when using Polyhedron_3<EPECK>, Marc Glisse, 02/17/2016
Archive powered by MHonArc 2.6.18.