Skip to content

Significant memory leak on macOS when using 2D displays in permanent section #489

Description

@AlexisDrogoul

Describe the bug
When running several experiments with a permanent output set to a 2D display (for instance, the "3 simulations" experiment of toy model "Ants Foraging", I have noticed a regular increase every time an experiment was closed. An inspection with YourKit reveals that the SwingControl/Java2DDisplaySurface objects are not disposed of, and still referenced by a number of components in the AWT hierarchy (Window, etc.). This issue does not seem to impact "regular" 2D displays (in the output section).

Could be somehow harmless, but several objects in this hierarchy maintain an IGraphicsScope, which itself maintains an AgentsContext full of references to ... agents, which are therefore never garbage collected.

Desktop (please complete the following information):

  • OS: macOS 15.4.1 (24E263)
  • PC Model: MBP Apple M3 Max
  • GAMA version: git
  • Java version: JDK 23
  • Graphics cards / Display system: Apple M3 Max

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

About Runtime & SimulationsConcerns the way simulations are being executedDisplay Java2DThis issue or request concerns only Java2D displays

Type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions