imagej / imagej/imagej2

Fixing "memory leaks" in ImageJ

Open
#168 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.4k
Forks
350
PR merge metrics
No merged PRs in 30d

Description

Dear all,

This is more of a general comment/request than any specific issue. I have been running through some plugins I have made recently dealing with improper allocation of object references and ironing out "memory leaks" (I could probably be more careful during my coding!).

It occurred to me during this assessment that it would be great if there was the ability to run a method which would reset ImageJ back to its initial setup - i.e. to take all the GC Roots and all the initial references which are required when ImageJ starts, and discarding all the rest, to allow ImageJ to "reset" itself back to its initial state, and therefore remove any aberrant references via GC and allow ImageJ to remain running free from any memory leaks/get back all the available memory to the JVM.

Does anyone know if such a function already exists? Essentially it would amount to restarting ImageJ just without actually having to manually close and re-open. This would be convenient for developers to execute at the end of a plugin run to keep ImageJ free of memory leaks.... Assuming they want to refresh the system, and do not have any images or other important objects open.

Thanks,

Steve.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by reviewing how ImageJ initializes and whether an existing reset or restart mechanism is available. Done would mean determining whether a safe in-process reset can discard plugin-created references without affecting intentionally open images or other objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-vision
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.