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

Memory Leak #965

Open
Martinsdevs opened this issue Aug 24, 2024 · 13 comments
Open

Memory Leak #965

Martinsdevs opened this issue Aug 24, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@Martinsdevs
Copy link

Describe the bug
Memory Leak: 100% ram get used very fast

Software brand
1.21.1 Paper. Great server host. No problem and runs fast.

Plugins
Run tests with https://heaphero.io/.
It told me clearly, where the memory leak was. (Tested this 2 times)

Also, tested this without the plugin. Came out without any leaks

28,046 instances of "java.lang.Class", loaded by "" occupy 241,775,368 (24.87%) bytes.
Biggest instances:

class com.github.retrooper.packetevents.protocol.world.states.WrappedBlockState @ 0x6269887a0 - 81,319,576 (8.36%) bytes.
class com.mojang.datafixers.types.Type @ 0x618d59a90 - 62,428,800 (6.42%) bytes.
class com.mojang.datafixers.functions.Fold @ 0x61e9139d8 - 53,648,016 (5.52%) bytes.

Expected behavior
No memory leak. but it came.

Screenshots

Additional context

@Martinsdevs Martinsdevs added the bug Something isn't working label Aug 24, 2024
@Tofaa2
Copy link
Contributor

Tofaa2 commented Aug 24, 2024

There's no memory leak, the data for all versions for WrappedBlockState is 80mb. Why are you running a 1.21 server on 1gb of ram

@Martinsdevs
Copy link
Author

It is. I have 8gb ram.

@semenishchev
Copy link

semenishchev commented Aug 24, 2024

There's no memory leak, the data for all versions for WrappedBlockState is 80mb. Why are you running a 1.21 server on 1gb of ram

Assuming you did a typo and it’s 80 bytes (not 80 megabytes) per instance and it’s still going to be 6 gigabytes worth of ram (81,319,576 x 80 / 1000000) = 6505 megabytes.

However I doubt that this is a packetevents issue, rather an issue of a plugin which uses packetevents.

Modern papers have spark built in, so run /spark profiler start --alloc --thread * and upload the results here

@casperwtf
Copy link

There's no memory leak, the data for all versions for WrappedBlockState is 80mb. Why are you running a 1.21 server on 1gb of ram

Assuming you did a typo and it’s 80 bytes (not 80 megabytes) per instance and it’s still going to be 6 gigabytes worth of ram (81,319,576 x 80 / 1000000) = 6505 megabytes.

However I doubt that this is a packetevents issue, rather an issue of a plugin which uses packetevents.

Modern papers have spark built in, so run /spark profiler start --alloc --thread * and upload the results here

No, under that logic why is com.mojang.datafixers.types.Type taking almost 5gb & com.mojang.datafixers.functions.Fold taking just over 4gb.

@Tofaa2
Copy link
Contributor

Tofaa2 commented Aug 25, 2024

There's no memory leak, the data for all versions for WrappedBlockState is 80mb. Why are you running a 1.21 server on 1gb of ram

Assuming you did a typo and it’s 80 bytes (not 80 megabytes) per instance and it’s still going to be 6 gigabytes worth of ram (81,319,576 x 80 / 1000000) = 6505 megabytes.

However I doubt that this is a packetevents issue, rather an issue of a plugin which uses packetevents.

Modern papers have spark built in, so run /spark profiler start --alloc --thread * and upload the results here

I am not sure how you did the math on whatever that is but 81319576 bytes of memory, depending on the platform, is anywhere between 77 to 81 mb of ram. My point still stands

@Tofaa2
Copy link
Contributor

Tofaa2 commented Aug 25, 2024

It is. I have 8gb ram.

Your jvm is running on 1gb, notice how the pe objects are using 8% of your memory, while being 80 mb

@Martinsdevs
Copy link
Author

https://spark.lucko.me/rORVhYTRMh Here it is. It can be that I have something wrong ofc. I don't doubt that either.

I use libs disguise, with the packetevent plugin

@Martinsdevs
Copy link
Author

https://spark.lucko.me/N6SkNKch8M This is without those 2 plugins

@semenishchev
Copy link

There's no memory leak, the data for all versions for WrappedBlockState is 80mb. Why are you running a 1.21 server on 1gb of ram

Assuming you did a typo and it’s 80 bytes (not 80 megabytes) per instance and it’s still going to be 6 gigabytes worth of ram (81,319,576 x [80 / 1000000](tel:80 / 1000000)) = 6505 megabytes.
However I doubt that this is a packetevents issue, rather an issue of a plugin which uses packetevents.
Modern papers have spark built in, so run /spark profiler start --alloc --thread * and upload the results here

I am not sure how you did the math on whatever that is but 81319576 bytes of memory, depending on the platform, is anywhere between 77 to 81 mb of ram. My point still stands

Aren’t this is 81319576 instances? The only way to calculate this is to know how much 1 instance takes. I’m not very familiar with that profiler

@semenishchev
Copy link

https://spark.lucko.me/rORVhYTRMh Here it is. It can be that I have something wrong ofc. I don't doubt that either.

I use libs disguise, with the packetevent plugin

This profiler has “no data”

@Martinsdevs
Copy link
Author

https://spark.lucko.me/CqJLMmwb81 here is a new report, with the plugins :)

@semenishchev
Copy link

https://spark.lucko.me/CqJLMmwb81 here is a new report, with the plugins :)

It looks like a third party problem. I see nothing wrong here

@Tofaa2
Copy link
Contributor

Tofaa2 commented Aug 25, 2024

There's no memory leak, the data for all versions for WrappedBlockState is 80mb. Why are you running a 1.21 server on 1gb of ram

Assuming you did a typo and it’s 80 bytes (not 80 megabytes) per instance and it’s still going to be 6 gigabytes worth of ram (81,319,576 x [80 / 1000000](tel:80 / 1000000)) = 6505 megabytes.
However I doubt that this is a packetevents issue, rather an issue of a plugin which uses packetevents.
Modern papers have spark built in, so run /spark profiler start --alloc --thread * and upload the results here

I am not sure how you did the math on whatever that is but 81319576 bytes of memory, depending on the platform, is anywhere between 77 to 81 mb of ram. My point still stands

Aren’t this is 81319576 instances? The only way to calculate this is to know how much 1 instance takes. I’m not very familiar with that profiler

No, it is that many bytes, not instances, it says it after the % symbol. This is also a known number in pe that wrapped block states take up 81 mb of ram

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants