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

Fixed trimming of the recorded test output #2040

Merged
merged 1 commit into from
Oct 5, 2023
Merged

Conversation

cmnrd
Copy link
Collaborator

@cmnrd cmnrd commented Oct 5, 2023

This fixes a bug in our test framework. It seems like Runtime.getRuntime().freeMemory() does not indicate the total memory that can still be allocated, but only the free memory that is already allocated by the runtime. Therefore, the recorded output was often cut prematurely. This fix only considers the size of the recorded string buffer. It also makes sure, that the buffer is trimmed after deleting elements.

This fixes a bug in our test framework. It seems like
`Runtime.getRuntime().freeMemory()` does not indicate the total memory that can
still be allocated, but only the free memory that is already allocated by the
runtime. Therefore, the recorded output was often cut prematurely.
This fix only considers the size of the recorded string buffer. It also makes
sure, that the buffer is trimmed after deleting elements.
@cmnrd cmnrd requested a review from erlingrj October 5, 2023 09:03
@erlingrj
Copy link
Collaborator

erlingrj commented Oct 5, 2023

Thanks alot, Christian. The PR looks good, I am testing this fix on my feature-branch. And will report back

Copy link
Collaborator

@erlingrj erlingrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well. LGTM!

@erlingrj erlingrj enabled auto-merge October 5, 2023 10:20
@erlingrj erlingrj added this pull request to the merge queue Oct 5, 2023
Merged via the queue into master with commit 0042432 Oct 5, 2023
@erlingrj erlingrj deleted the test-fix-free-memory branch October 5, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants