Hello Heinrich,

Thanks for the explanations.
Best regards,

*Sylvain Fournier*
 Analista de Pesquisa Operacional
*48 3239-2423*
WPLEX Software Ltda.
Rod SC 401 no. 8600 Corporate Park bloco 5 sala 101
88050-000 Santo Antônio de Lisboa, Florianópolis SC +55 48 3239-2400
wplex.com.br
[image: WPLEX]



2014-03-19 18:08 GMT-03:00 Heinrich Schuchardt <[email protected]>:

> Hello Sylvain,
>
> this is the comment in src/env/env.c:
>
> *  int glp_free_env(void);
> *
> *  DESCRIPTION
> *
> *  The routine glp_free_env frees all resources used by GLPK routines
> *  (memory blocks, etc.) which are currently still in use.
> *
> *  Normally the application program does not need to call this routine,
> *  because GLPK routines always free all unused resources. However, if
> *  the application program even has deleted all problem objects, there
> *  will be several memory blocks still allocated for the library needs.
> *  For some reasons the application program may want GLPK to free this
> *  memory, in which case it should call glp_free_env.
> *
> *  Note that a call to glp_free_env invalidates all problem objects as
> *  if no GLPK routine were called.
>
> On of the aforementioned memory blocks is the environment structure itself
> which is allocated in glp_init_env.
>
> When a program completely ends all assigned memory is freed by the
> operating system.
>
> Best regards
>
> Heinrich Schuchardt
>
>
>
> On 19.03.2014 13:52, Sylvain Fournier wrote:
>
>> Hi,
>>
>> Thanks Heinrich, your comment helped me get rid of a memory leak I had
>> in my application: although it is done correctly in the examples
>> provided with GLPK for Java, I had forgotten to free the array memory
>> using the delete methods. I was only freeing the problem memory using
>> glp_delete_prob().
>> Now is it necessary to call glp_free_env() at the end of the program, or
>> does GLPK take care of it itself in the case it exits without any error?
>> You say that GC doesn't free the memory assigned in the GLPK library but
>> in the examples, I only saw the call to this method in one case using
>> several threads (GmplSwing). Why is it necessary in this case and not in
>> the other examples?
>>
>> *Sylvain Fournier*
>>
>
>
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to