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

Opt to not load the WrappedBlockStates #941

Open
1 of 6 tasks
imkunet opened this issue Aug 15, 2024 · 3 comments
Open
1 of 6 tasks

Opt to not load the WrappedBlockStates #941

imkunet opened this issue Aug 15, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@imkunet
Copy link

imkunet commented Aug 15, 2024

Is your feature request related to a problem? Please describe.

Due to the nature of being on a 1.8 server with zero budget, heap space is gold.

image

For my purposes (which I'd imagine many relate to) this heap space is wasted space.

Describe the solution you'd like

Allow for not loading the WrappedBlockStates when using the SpigotPacketEventsBuilder.
image

Kind of like this, but not awful.

Describe alternatives you've considered to solve your solution without us adding this as a feature?

  • Copy paste the class and just comment it out (hacky)
  • Buy better servers (no money)
  • Instrument the class at runtime (why would you do this)
  • Use reflection to empty the maps (...no)
  • Use sun.misc.Unsafe to free the memory (technically unsafe, as the name implies)
  • Coerce the memory into loading into specific pages, then forcibly put into swap (degrades gc performance)
@imkunet imkunet added the enhancement New feature or request label Aug 15, 2024
@rafi67000
Copy link
Contributor

you never know if WrappedBlockStates will be needed or not. It would be a shading-only feature.

@LeeGodSRC
Copy link
Contributor

Maybe provide the functionality to customize it for plugins that shades PacketEvents?
For example adding an option called MappingExemptStrategy with ALL, CURRENT_VERSION, NONE, and load the mappings that matches the strategy etc etc.

@booky10
Copy link
Collaborator

booky10 commented Aug 17, 2024

I would be more in favor of a system property or just reverting back to lazy-loading the mappings.
On spigot/paper everything except the server version isn't used anyway, as far as I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
4 participants