KingContaria / seedqueue

Minecraft mod that generates multiple worlds concurrently and lets players reset them on an ingame wall screen.
MIT License
32 stars 18 forks source link

Feature: Warning for high or low max allocated RAM #65

Open Crystal15118 opened 2 months ago

Crystal15118 commented 2 months ago

Added a method which checks the ram allocation and then gives a warning if it is offset by 1100 MB from the recommended max ram allocation. The offset for 1100 is set because AA-like categories use about 1000 MB more than other categories. MultiMC's Ram Allocation amounts may pass the 1000 MB barrier as its not rounded up to the nearest thousand and instead is a bit above, to avoid it, we add 100 more to the 1000 MB. There's also a system property to disable it (inspiration from system information logging because very few people may find it desire-able to completely avoid the warning).

Crystal15118 commented 2 months ago

this should bring up a screen like ranked currently does (https://i.imgur.com/Stir6Cx.png); nobody is going to see a random warning in a log

Is that allowed to be done by a mod? (i.e does it violate src rules or something? I'm not sure but yea we could definitely do that if its legal)

it should only warn you if you don't have enough RAM allocated

Why? "The more RAM you have the more java will struggle with keeping it all neat and tidy" - contaria

1100 feels like a rather random number to try to apply to all instance counts, smth like if (allocatedRam < 1800 + 180 * numberOfInstances) { showWarning; } feels more logical, though i have no clue what would be an appropriate value to put in place of my 180

It's not random, 1000 MB is usually the amount of max ram which AA-like categories would need. Multimc's way of changing allocated RAM if done by the arrows given for increasing or decreasing doesn't really put it on a rounded thousand number like 1000 MB (i.e AA-like category runners might allocate just a bit above because of that feature) instead it has it a bit above i.e it might be (maxRecommendedRam +1032) MB for AA-like category runners. To avoid it i just added a 100 to the previous 1000 we had and then the feature no longer poses threat to users being warned even tho its not a big deal.

maskersss commented 2 months ago

Is that allowed to be done by a mod?

i don't see why it wouldn't be?

Why?

i don't feel like it's bad enough to yell at the user about it, i don't exactly know what i'm talking about but i'm sure you wouldn't notice a difference between 10 GB allocated and 12 GB allocated, especially if you're using SoftMaxHeapSize set to the same value; and if you're not, i'd imagine you'd have lag spikes either way

It's not random

well yeah i see your logic, "random" wasn't really the right word there, my point was that it's probably fine to allocate 9500 MB instead of 10 000, while 1500 instead of 2000 is definitely too little