Skip to content

Add option to limit baltop entries#6300

Merged
JRoy merged 5 commits intoEssentialsX:2.xfrom
maxcom1:baltop-entry-limit
Sep 29, 2025
Merged

Add option to limit baltop entries#6300
JRoy merged 5 commits intoEssentialsX:2.xfrom
maxcom1:baltop-entry-limit

Conversation

@maxcom1
Copy link
Contributor

@maxcom1 maxcom1 commented Sep 21, 2025

# Allows to limit cached balance top (/baltop) entries. This is especially recommended if
# you have a large number of players, then only a certain number of entries will be stored
# in the server's memory. Set to -1 to disable the limit
baltop-entry-limit: -1

Copy link
Member

@JRoy JRoy left a comment

Choose a reason for hiding this comment

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

i suppose this is okay but wouldn't this literally be like MAYBE a KB of data? the actual user data doesn't stay loaded in memory

@maxcom1
Copy link
Contributor Author

maxcom1 commented Sep 24, 2025

A KB of data could fit ~ 10-15 players, java object header sizes should also be taken into account. This calculation does not include SimpleTextInput which is created for storing Components of baltop entries, it also eats some memory (propably even more than the LinkedHashMap<UUID, BalanceTop.Entry> topCache which is discussed).

But it's not just about memory. I've often seen people want to limit the balance to, say, three pages, because in practice, there's another side effect of showing so many entries. Players can simply iterate through balance pages and thus see the exact amount of money that other players have, which isn't desirable on every server (after all, the 'essentials.balance.others' permission isn't given out to everybody).

I don't see a reason not to merge this small change, but if you have any concerns, feel free to ask

Copy link
Member

@JRoy JRoy left a comment

Choose a reason for hiding this comment

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

small nitpick, otherwise good

@JRoy JRoy enabled auto-merge September 29, 2025 02:33
@JRoy JRoy added this pull request to the merge queue Sep 29, 2025
Merged via the queue into EssentialsX:2.x with commit ca7f3b5 Sep 29, 2025
1 check passed
Euphillya added a commit to Euphillya/Essentials-Folia that referenced this pull request Oct 6, 2025
EssentialsX@ca7f3b5 Add option to limit baltop entries (EssentialsX#6300)
EssentialsX@893bae0 Change baltop entry limit wording (EssentialsX#6306)
EssentialsX@65120e9 Update to Minecraft 1.21.9 (EssentialsX#6299)
EssentialsX@22b4975 Fixes stale cached locations after using /settpr (EssentialsX#6305)
EssentialsX@8982aae Fix updating join message when not needed (EssentialsX#6312)
EssentialsX@4dabeb5 Fix GeoIP dependencies (EssentialsX#6314)
EssentialsX@264b0ed Improve memory resilience with Configurate (EssentialsX#6266)
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.

2 participants