Skip to content

[DO NOT MERGE] Allocating fixed size for upload chunk content - #554

Draft
Gautham-coder wants to merge 1 commit into
v3.x/stagingfrom
chunk-memory-upload
Draft

[DO NOT MERGE] Allocating fixed size for upload chunk content#554
Gautham-coder wants to merge 1 commit into
v3.x/stagingfrom
chunk-memory-upload

Conversation

@Gautham-coder

@Gautham-coder Gautham-coder commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

Issue

While #540 did resolve the memory leak for 64bit, the PR had this note
The current behavior is such that we don't see increase the memory till the chunk size is equal to or less than the one used initially. That is, it is advisable to use the same chunk size for all the chunks.

Proposed changes

This PR will be used to discuss the possibility of using a fixed size buffer irrespective of the content length, with this in the increase in memory is seen only initially. Varying content size causes no further increase. The Fixed memory size is set to 6MB for testing

This PR addresses Issue: zowe/zss#777

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Change in a documentation
  • Refactor the code
  • Chore, repository cleanup, updates the dependencies.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

PR Checklist

Please delete options that are not relevant.

  • If the changes in this PR are meant for the next release / mainline, this PR targets the "staging" branch.
  • My code follows the style guidelines of this project (see: Contributing guideline)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes
  • video or image is included if visual changes are made
  • Relevant update to CHANGELOG.md
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works, or describe a test method below

Testing

Upload chunks less than 6MB

Further comments

Needs discussion with the squad.
There are other places that process this chunk and allocate memory for ex

char *dataToWrite = safeMalloc(dataToWriteSize, "CONVERT BUFFER");

Start up:
working_Mem_start

Without fix the PRIVATE-64 value can be seen increasing to 1GB for large files.

With fix, after upload:
working_Mem_after

Signed-off-by: Gautham Kuppuswamy <gkuppuswamy@rocketsoftware.com>
@Gautham-coder
Gautham-coder marked this pull request as draft September 10, 2025 14:48
@Gautham-coder Gautham-coder changed the title Allocating fixed size for upload chunk content [DO NOT MERGE] Allocating fixed size for upload chunk content Sep 10, 2025
@github-actions github-actions Bot added the stale-reopen-if-needed An issue closed due to inactivity. No indication of completion or validity. label Mar 9, 2026
@sonarqubecloud

Copy link
Copy Markdown

@github-actions github-actions Bot removed the stale-reopen-if-needed An issue closed due to inactivity. No indication of completion or validity. label Mar 11, 2026
@github-actions github-actions Bot added the stale-reopen-if-needed An issue closed due to inactivity. No indication of completion or validity. label Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale-reopen-if-needed An issue closed due to inactivity. No indication of completion or validity.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant