Skip to content

Memory leak when using jscip.MessageHandler #53

@patrickguenther

Description

@patrickguenther

It's not a large leak but could become a nuisance for long running applications that solve many optimization problems.

The leak was discovered by accident, while debugging an entirely different issue. The attached screenshot shows a heap dump of our application created by visualvm.

image

The number of retained ScipMessageHandler instances only goes up while running more optimization problems and never down even after explicitly invoking garbage collection.

The generated code for jscip.MessageHandler has a close method with an empty body defined. I guess the expected behavior would be that it frees _messagehdlrptr somehow? Or do I need to call some other JSCIP method to free it?

In the meantime, workarounds are:

  • ignore the problem as the leak is not that large
  • don't use message handlers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions