Skip to content

Cyclic initialization & deinitilization of persistent.Map cause memory leak  #356

@hicolour

Description

@hicolour

In a single application life cycle I have a need to use multiple times fresh instance of persistence map to reduce pressure on memory.

    val map = {
      persistent.Map[String, Int, Nothing, Glass](File.newTemporaryDirectory("suggestions_topn_").deleteOnExit().path)
    }

when the business operation is completed ( multiple map.put and one map.values.foreach ) persistent map is being closed using

map.close()

After multiple cycles memory is being occupied by swaydb.core.level.zero.LevelZeroMapCache that have root reference in scala.sys.ShutdownHookThread

image

image

It is not clear from docs is something else e.g. map.delete should be called to clear references.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingproduction releaseTasks required for production release

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions