Skip to content

Commit

Permalink
Output free memory
Browse files Browse the repository at this point in the history
DAFFODIL-XXX
  • Loading branch information
stevedlawrence committed May 30, 2024
1 parent dc55874 commit 0e48198
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
AR: ${{ matrix.env_ar }}
CC: ${{ matrix.env_cc }}
LANG: ${{ matrix.lang }}.${{ matrix.encoding }}
SBT: sbt -J-Xms1024m -J-Xmx5120m -J-XX:ReservedCodeCacheSize=512m -J-XX:MaxMetaspaceSize=1024m -J-Dfile.encoding=${{ matrix.encoding }} ++${{ matrix.scala_version }} coverage
SBT: sbt ++${{ matrix.scala_version }} coverage
SONARSCAN: ${{
matrix.os == 'ubuntu-22.04' &&
matrix.java_version == '17' &&
Expand All @@ -102,6 +102,28 @@ jobs:
# Setup
############################################################

- name: Install Dependencies (All)
shell: bash
run: |
npm install systeminformation
- name: Set JAVA_OPTS
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const si = require('systeminformation');
// max memory given to JVM is the total memory in megabytes with 1GB saved for the system
const maxMem = await si.mem().then((memData) => { return Math.floor(memData.total / (1024 * 1024)) - 1024; });
const java_opts = [
'-Xmx' + maxMem + 'm',
'-Xms1024m',
'-XX:ReservedCodeCacheSize=512m',
'-XX:MaxMetaspaceSize=1024m',
'-Dfile.encoding=${{ matrix.encoding }}',
]
core.info(java_opts.join(' '));
core.exportVariable('JAVA_OPTS', java_opts.join(' '));
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: |
Expand Down Expand Up @@ -166,7 +188,9 @@ jobs:
############################################################

- name: Compile
run: $SBT compile Test/compile daffodil-test-integration/Test/compile
run: |
echo $JAVA_OPTS
$SBT compile Test/compile daffodil-test-integration/Test/compile
- name: Build Documentation
run: $SBT unidoc
Expand Down

0 comments on commit 0e48198

Please sign in to comment.