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

fix random string used in test allocating 50MB in Cortex binary #5903

Merged
merged 1 commit into from Apr 26, 2024

Conversation

yeya24
Copy link
Collaborator

@yeya24 yeya24 commented Apr 26, 2024

What this PR does:

We initialize RandomStrings in pkg/util/test_util.go which allocates 50MB data in heap in Cortex binary. This variable is used only in tests. The increased also showed up in the heap dump below.

image

In this PR I removed the global variable for RandomStrings in pkg/util and move it to specific test files instead. This should reduce the memory usage in heap.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@alanprot
Copy link
Member

:P My bad! haha

@yeya24 yeya24 merged commit 55f996c into cortexproject:master Apr 26, 2024
16 checks passed
@yeya24 yeya24 deleted the fix-random-string-allocation branch April 26, 2024 18:18
Kramer0x0 pushed a commit to Kramer0x0/cortex that referenced this pull request Apr 26, 2024
yeya24 added a commit to yeya24/cortex that referenced this pull request Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants