Skip to content

Potential memory leak #283

@sboardwell

Description

@sboardwell

Describe the bug

The events file manager loads all files in memory before continuing: https://github.com/segmentio/analytics-kotlin/blob/d74172114cb5eea544eeda3e6a219b2899a741c2/core/src/main/java/com/segment/analytics/kotlin/core/utilities/EventsFileManager.kt#L102C1-L103C1

In the case of air-gapped environment or and otherwise broken network, the files in the directory could build up and eventually become an issue for the JVM.

To Reproduce
Steps to reproduce the behavior:

  1. Create a lot of events without having access to api.segment.io
  2. Monitor the memory usage
  3. See error

Expected behavior

It would be better to have the files loaded via a stream as opposed to loading them all at once.

Screenshots

n/a

Platform (please complete the following information):

  • Library Version in use: 1.19.2
  • Platform being tested: Standard JVM
  • Integrations in use: n/a

Additional context

n/a

Metadata

Metadata

Assignees

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