Skip to content

Fix MemoryStarved ITs#4024

Merged
ctubbsii merged 2 commits intoapache:mainfrom
ctubbsii:memory-starved-it-bug
Dec 6, 2023
Merged

Fix MemoryStarved ITs#4024
ctubbsii merged 2 commits intoapache:mainfrom
ctubbsii:memory-starved-it-bug

Conversation

@ctubbsii
Copy link
Copy Markdown
Member

@ctubbsii ctubbsii commented Dec 5, 2023

Rewrite MemoryConsumingIterator's method to compute the amount of memory to consume, so that:

  • The implementation is more comprehensible
  • Replace exception with bounds checking
  • Avoid allocating more than necessary (a single byte is sufficient)
  • The log message includes the amount of used memory detected
  • The waiting message appears, even when memory was allocated, because that's the behavior
  • Give the GC more time to detect the changed GC condition before trying to detect the low memory condition

Also, remove hard-coded comments for size of heap and incorrect interval frequency, and increase the configured free memory threshold, so that the memory percentage isn't so low, it doesn't get lower than the minimum that G1GC needs to do its job by default on a 256K VM.

This fixes #3868

Also include trivial fixes:

  • Fix deprecation warning issues for getSplitCreationTime by making impl class deprecated instead of suppressing the interface deprecation, and use regular deprecations, not forRemoval=true, which complicates the way deprecations get inherited (see comments on Mark TabletStatistics.getSplitCreationTime as deprecated #3977)
  • Remove unused Logger

Rewrite MemoryConsumingIterator's method to compute the amount of memory
to consume, so that:

* The implementation is more comprehensible
* Replace exception with bounds checking
* Avoid allocating more than necessary (a single byte is sufficient)
* The log message includes the amount of used memory detected
* The waiting message appears, even when memory was detected, because
  that's the behavior
* Give the GC more time to detect the changed GC condition before trying
  to detect the low memory condition

Also, remove hard-coded comments for size of heap and incorrect interval
frequency, and increase the configured free memory threshold, so that
the memory percentage isn't so low, it doesn't get lower than the
minimum that G1GC needs to do its job by default on a 256K VM.

This fixes apache#3868

Also include trivial fixes:

* Fix deprecation warning issues for getSplitCreationTime by making impl
  class deprecated instead of suppressing the interface deprecation, and
  use regular deprecations, not forRemoval=true, which complicates the
  way deprecations get inherited (see comments on apache#3977)
* Remove unused Logger
@ctubbsii
Copy link
Copy Markdown
Member Author

ctubbsii commented Dec 6, 2023

These changes finished a build with the full ITs, and these tests did not fail... they didn't even flake. They seem to pass consistently now with these changes.

@dlmarion
Copy link
Copy Markdown
Contributor

dlmarion commented Dec 6, 2023

As I mentioned here, I think the deprecation changes should be removed from this PR and included in a new PR that also includes the forRemoval annotations on the Deprecated annotations in the Property class. Having this a separate PR would allow us to discuss the merits of forRemoval and hopefully put this issue to rest.

Copy link
Copy Markdown
Contributor

@dlmarion dlmarion left a comment

Choose a reason for hiding this comment

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

The MemoryStarved*IT changes look good. I have a suggestion regarding the deprecation changes elsewhere.

Copy link
Copy Markdown
Member Author

@ctubbsii ctubbsii left a comment

Choose a reason for hiding this comment

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

Restore unrelated forRemoval=true stuff.

@ctubbsii ctubbsii merged commit a3444f7 into apache:main Dec 6, 2023
@ctubbsii ctubbsii deleted the memory-starved-it-bug branch December 6, 2023 19:46
@ctubbsii
Copy link
Copy Markdown
Member Author

ctubbsii commented Dec 6, 2023

I created #4032 for the forRemoval stuff.

@ctubbsii ctubbsii added this to the 3.1.0 milestone Jul 12, 2024
@ctubbsii ctubbsii modified the milestones: 3.1.0, 4.0.0 Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken or Flaky test: MemoryStarvedMinCIT, MemoryStarvedMajCIT

2 participants