Skip to content

Memory leak when using transition_in/transition_out animations #4

@pr1k0l

Description

@pr1k0l

Description

Memory leak occurs when using transition_in and transition_out properties on DivKit elements. After navigating away from a screen with rendered DivKit content that contains these animation properties, multiple DivKit classes remain in memory and are not deallocated.

Steps to Reproduce

  1. Create a DivKit view with elements that have transition_in and transition_out properties configured
  2. Render the DivKit content on a screen
  3. Navigate away from the screen (dismiss/pop the view controller)
  4. Monitor memory using Xcode Memory Graph Debugger or Instruments

Expected Behavior

All DivKit-related objects should be deallocated when the view controller is dismissed and no longer in use.

Actual Behavior

Multiple DivKit classes remain in memory after the screen is dismissed. The objects are not released, causing a memory leak.

Sample JSON

The leak can be reproduced with the following DivKit JSON configuration:
https://gist.github.com/pr1k0l/08843edf8d8a944e21d79467156d6694

Key elements causing the issue:

{
  "type": "gallery",
  "id": "animated_gallery",
  "transition_in": {
    "type": "fade",
    "duration": 2000
  },
  "transition_out": {
    "type": "scale",
    "duration": 2000
  },
  "visibility": "@{ variable_2_1_1 }",
  "items": [...]
}

Environment

  • Platform: iOS
  • DivKit version: 32.6.0 – 32.34.0
  • Xcode version: 26.1.1
  • iOS version: 26.1

Additional Notes

The memory leak only appears when transition_in and/or transition_out properties are present. Removing these properties resolves the issue, and the DivKit objects are properly deallocated.

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