Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > TinyBrain | #1008034 - Set Global JavaX Option: Even Smaller Heap (G1, 10-20% slack)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar - homepage

Libraryless. Click here for Pure Java version (1612L/10K/38K).

!752

p {
  S s = javaxDefaultVMArgs(), old = s;
  print("Default VM Args: " + quote(s));
  s = s.replaceAll("-XX:MaxHeapFreeRatio=\\d+", "");
  s = s.replaceAll("-XX:MinHeapFreeRatio=\\d+", "");
  s = trim(s);
  s = trim(s + " -XX:MaxHeapFreeRatio=20 -XX:MinHeapFreeRatio=10");
  if (!s.contains("-XX:+UseG1GC")) s = trim(s + " -XX:+UseG1GC");
  if (neq(old, s))
    setDefaultVMArgs(s);
  else
    print("Keeping.");
}

Author comment

Began life as a copy of #1006272

download  show line numbers  debug dex   

Travelled to 2 computer(s): cfunsshuasjs, tvejysmllsmz

No comments. add comment

Snippet ID: #1008034
Snippet name: Set Global JavaX Option: Even Smaller Heap (G1, 10-20% slack)
Eternal ID of this version: #1008034/5
Text MD5: cdeeb298a79cb632e336d11268547639
Transpilation MD5: 8fb1adc90170f4aecd2239f5b4dcc217
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-21 14:50:25
Source code size: 434 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 14 / 26
Version history: 4 change(s)
Referenced in: [show]