Why the extremely large default value MaxDirectMemorySize=1048576g at start-up?

72 views
Skip to first unread message

BK BK

unread,
Apr 26, 2021, 5:07:16 AM4/26/21
to terracotta-oss
Hi Everyone,

I have a question, in 2 parts. It concerns the start-up file Terracotta\server\bin\start-tc-server.bat.

1) Is the unit "g" for MaxDirectMemorySize in Gigabyte?
2) If so, why is it so enormous (1048576g)?

You will find the code involved below.

Thanks.

Stay safe. Stay well.


================= Code excerpt =============
for %%C in ("\bin\java -d64 -server -XX:MaxDirectMemorySize=1048576g" "\bin\java -server -XX:MaxDirectMemorySize=1048576g" "\bin\java -d64 -client  -XX:MaxDirectMemorySize=1048576g" "\bin\java -client -XX:MaxDirectMemorySize=1048576g" "\bin\java -XX:MaxDirectMemorySize=1048576g") do (
  set JAVA_COMMAND=%JAVA_HOME%%%~C
  %JAVA_HOME%%%~C -version > NUL 2>&1
  if not errorlevel 1 (
    goto found_command
  )
)

BK BK

unread,
Apr 26, 2021, 5:15:02 AM4/26/21
to terracotta-oss
By the way, my version is 4.3.6

chris.w...@gmail.com

unread,
May 19, 2021, 8:55:47 AM5/19/21
to terracotta-oss
MaxDirectMemorySize is just a limit on how much direct memory the JVM can allocate. Since Terracotta users have vastly different resource needs the start script simply sets the MaxDirectMemorySize high enough that it isn't a limiting factor in any deployment. Specifically this setting has no bearing on how much memory the JVM actually allocates.

Chris

BK BK

unread,
May 26, 2021, 11:24:32 AM5/26/21
to terraco...@googlegroups.com
Hi Chris, 
Thanks for your reply.
Nevertheless, my question remains unanswered: "Is the unit "g" for MaxDirectMemorySize in Gigabyte? If so, why is it so enormous (1048576g)?"


--
You received this message because you are subscribed to the Google Groups "terracotta-oss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terracotta-os...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terracotta-oss/10552dce-dcd7-4059-86b3-dd2098bf69abn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages