@appthreat/atom 0.9.2 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -8,9 +8,9 @@ const LOG4J_CONFIG = path.join(__dirname, "plugins", "log4j2.xml");
8
8
  const ATOM_HOME = path.join(__dirname, "plugins", "atom-1.0.0");
9
9
  const APP_LIB_DIR = path.join(ATOM_HOME, "lib");
10
10
  const freeMemoryGB = Math.floor(os.freemem() / 1024 / 1024 / 1024);
11
- const JAVA_OPTS = `${
12
- process.env.JAVA_OPTS || ""
13
- } -Xms${freeMemoryGB}G -Xmx${freeMemoryGB}G`;
11
+ const JAVA_OPTS = `${process.env.JAVA_OPTS || ""} -Xms${Math.round(
12
+ Math.floor(freeMemoryGB / 2)
13
+ )}G -Xmx${freeMemoryGB}G -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent -XX:+ParallelRefProcEnabled -XX:+UseStringDeduplication -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:+UnlockDiagnosticVMOptions -XX:G1SummarizeRSetStatsPeriod=1`;
14
14
  const APP_MAIN_CLASS = "io.appthreat.atom.Atom";
15
15
  let APP_CLASSPATH = path.join(
16
16
  APP_LIB_DIR,
@@ -27,16 +27,17 @@ if (process.env.JAVA_HOME) {
27
27
 
28
28
  const atomLibs = [APP_CLASSPATH];
29
29
  const argv = process.argv.slice(2);
30
- const args = [
31
- "-cp",
32
- atomLibs.join(path.delimiter),
33
- `-Dlog4j.configurationFile=${LOG4J_CONFIG}`,
34
- APP_MAIN_CLASS,
35
- ...argv
36
- ];
30
+ let args = JAVA_OPTS.trim()
31
+ .split(" ")
32
+ .concat([
33
+ "-cp",
34
+ atomLibs.join(path.delimiter),
35
+ `-Dlog4j.configurationFile=${LOG4J_CONFIG}`,
36
+ APP_MAIN_CLASS,
37
+ ...argv
38
+ ]);
37
39
  const env = {
38
40
  ...process.env,
39
- JAVA_OPTS,
40
41
  ATOM_HOME
41
42
  };
42
43
  const cwd = process.env.ATOM_CWD || process.cwd();
@@ -45,5 +46,6 @@ spawnSync(JAVACMD, args, {
45
46
  env,
46
47
  cwd,
47
48
  stdio: "inherit",
48
- stderr: "inherit"
49
+ stderr: "inherit",
50
+ timeout: undefined
49
51
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appthreat/atom",
3
- "version": "0.9.2",
3
+ "version": "0.10.1",
4
4
  "description": "Create atom (⚛) representation for your application, packages and libraries",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -13,7 +13,7 @@
13
13
  "yargs": "^17.7.2"
14
14
  },
15
15
  "devDependencies": {
16
- "eslint": "^8.42.0"
16
+ "eslint": "^8.43.0"
17
17
  },
18
18
  "bin": {
19
19
  "atom": "./index.js",