Browse Source

Timings - Xmx = Xms

master
DrBot7 4 years ago
committed by GitHub
parent
commit
c8cae08b2d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 28
      cogs/timings.py

28
cogs/timings.py

@ -117,15 +117,6 @@ class Timings(commands.Cog):
embed_var.add_field(name="⚠ Outdated Flags",
value="Add `-XX:G1MixedGCCountTarget=4` to flags",
inline=True)
else:
embed_var.add_field(name="⚠ Aikar's Flags",
value="Use [Aikar's flags](https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/).",
inline=True)
except KeyError:
unchecked = unchecked + 1
try:
flags = r["timingsMaster"]["system"]["flags"]
if "-Xmx" in flags:
max_mem = 0
flaglist = flags.split(" ")
@ -140,9 +131,26 @@ class Timings(commands.Cog):
embed_var.add_field(name="⚠ Low Memory",
value="Allocate at least 6-10GB of ram to your server if you can afford it.",
inline=True)
if "-Xms" in flags:
min_mem = 0
flaglist = flags.split(" ")
for flag in flaglist:
if flag.startswith("-Xmx"):
min_mem = flag.split("-Xmx")[1]
min_mem = min_mem.replace("G", "000")
min_mem = min_mem.replace("M", "")
min_mem = min_mem.replace("g", "000")
min_mem = min_mem.replace("m", "")
if min_mem != max_mem:
embed_var.add_field(name="⚠ Aikar's Flags",
value="Your Xmx and Xms values must be equal with Aikar's flags.",
inline=True)
else:
embed_var.add_field(name="⚠ Aikar's Flags",
value="Use [Aikar's flags](https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/).",
inline=True)
except KeyError:
unchecked = unchecked + 1
try:
cpu = int(r["timingsMaster"]["system"]["cpu"])
if cpu <= 2:

Loading…
Cancel
Save