Skip to content

Memory leak in get_keras_h5_layers #82

Closed
@jacobwilliams

Description

@jacobwilliams

In get_keras_h5_layers, this code:

    call json % parse(model_config_json, model_config_string)

allocates the local model_config_json pointer, but it is not destroyed in this routine, so that's a memory leak. You should add a:

   call json % destroy (model_config_json)

At the end to free the memory. The other json_value pointers all look like they are just pointing to data inside this structure, so you don't have to worry about those.

FYI: the higher-level json_file class is a little safer (but less flexible) to use since it will destroy the pointer when it goes out of scope (it has a finalizer). What you have here is fine though (you just need the destroy call at the end).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions