Improve memory estimation of CacheLongKeyLIRS and correct some passed memory sizes by katzyn · Pull Request #3626 · h2database/h2database

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@katzyn

Copy link

Contributor

@katzyn katzyn commented

Sep 11, 2022

  1. Maximum size of CacheLongKeyLIRS now includes approximate size of the cache itself. It doesn't have any significant impact when large objects are cached, but it prevents excessive memory usage when very small objects are cached.
  2. Incorrect sizes of objects passed to MVStore.chunksToC are corrected.
  3. Default object size is changed from 1 byte to 16 bytes (typical size of java.lang.Object).
  4. Size of a cached object is now stored as long to prevent possible overflows (with large cached arrays, for example).

Related issue: #3625

Copy link

Contributor

@andreitokar andreitokar left a comment

Choose a reason for hiding this comment

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

LGTM

@katzyn katzyn merged commit 067969f into h2database:master

Sep 11, 2022

@katzyn katzyn deleted the cache branch

September 11, 2022 14:12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@andreitokar andreitokar andreitokar approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@katzyn @andreitokar