help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] Re: GLPK memory leak?


From: Robbie Morrison
Subject: [Help-glpk] Re: GLPK memory leak?
Date: Fri, 29 Oct 2010 12:34:07 +1300 (NZDT)
User-agent: SquirrelMail/1.4.17

Hello Adriana

Regarding memory leakage.

You mentioned earlier you create a lot of easy GLPK
instances.  Would that number in the thousands then?

And do you delete these GLPK instances when you've
finished with them?  Or do you let them stack up in the
street instead?  If so, that would be a client-side
issue!

For those programming in C++.  Enclose the GLPK
instance in a dedicated class and then add
'glp_delete_prob' to the destructor.  When instances of
that class go out of scope, the resources used by GLPK
will automatically release.  You can use the same idiom
for closing files too without having to remember to add
dedicated code.  This particular design pattern is
described in one of Scott Meyers books, if I recall
correctly.

regards Robbie
---
Robbie Morrison
PhD student -- policy-oriented energy system simulation
Technical University of Berlin (TU-Berlin), Germany
University email (redirected) : address@hidden
Webmail (preferred)           : address@hidden
[from Webmail client]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]