Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High Memory Utilization in LogWatcher of the Due to Unmanaged StringBuilder #3540

Closed
JanakaPushpakumara opened this issue Jan 24, 2025 · 2 comments

Comments

@JanakaPushpakumara
Copy link

Description

Hi Team,

We have identified a high memory utilization issue in the LogWatcher class [1] in the diagnostic-tool [2]. The StringBuilder used to accumulate log data is not being managed properly, leading to excessive memory usage. This issue was detected through a heap dump analysis using Eclipse MAT, which pointed to a large byte[] instance retained by the StringBuilder.

[1] https://github.com/wso2/runtime-diagnostic-tool/blob/c70186279d8cf9cba3055d690f8d53ab1df4a600/src/main/java/org/wso2/diagnostics/watchers/logwatcher/LogWatcher.java
[2] https://apim.docs.wso2.com/en/4.3.0/troubleshooting/utilizing-runtime-diagnostic-tool/

Thanks,
Janaka.

Steps to Reproduce

  1. Run the wso2am 4.3.0 with the LogWatcher class active.
  2. Monitor memory usage of the diagnostic-tool over time.
  3. Observe the high memory consumption and potential memory leak.

Version

4.3.0

Environment Details (with versions)

No response

@npamudika
Copy link

This is fixed in the master branch with wso2/runtime-diagnostic-tool#12

@npamudika
Copy link

Upgraded the diagnostic tool version in APIM master brach with wso2/product-apim#13646

@npamudika npamudika modified the milestones: APIM 4.5.0 , 4.5.0-M2 Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants