AAVSO / VStar

VStar is a visualisation and analysis tool for variable star data brought to you by AAVSO
https://www.aavso.org/vstar
GNU Affero General Public License v3.0
9 stars 3 forks source link

VStar.sh fails to detect 64 bit system in the presence of ARM #386

Closed dbenn closed 7 months ago

dbenn commented 7 months ago

First detected on an ARM M2 Apple Silicon Mac.

The following:

# 32 or 64 bit?
VER=`uname -a | grep _64`

needs to change to:

# 32 or 64 bit?
VER=`uname -a | grep 64`
dbenn commented 7 months ago

This will affect any ARM system. I have also repeated the same problem on a Raspberry Pi4.

dbenn commented 7 months ago

The impact is that the maximum heap memory selected ends up being smaller than it should be (1500 MB).

dbenn commented 7 months ago

On M2 Mac, without the change:

bash -x VStar.sh 
++ dirname VStar.sh
+ APP_DIR=.
++ uname -a
++ grep 64
+ VER='Darwin meeus-2.local 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:53:19 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6020 arm64'
+ '[' 'Darwin meeus-2.local 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:53:19 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6020 arm64' '!=' '' ']'
++ echo darwin22
++ grep darwin
+ '[' darwin22 '!=' '' ']'
+++ sysctl -n hw.memsize
++ perl -e 'print int(34359738368 / (1024*1024*1024) / 2);'
+ HALF_MEM=16
+ '[' 16 == '' ']'
+ '[' 16 == 0 ']'
+ MAX_MEM=16g
+ java -splash:./extlib/vstaricon.png -Xms800m -Xmx16g -jar ./dist/vstar.jar
meeus:vstar david$ bash -x VStar.sh 
++ dirname VStar.sh
+ APP_DIR=.
++ uname -a
++ grep _64
+ VER=
+ '[' '' '!=' '' ']'
+ MAX_MEM=1500m
+ java -splash:./extlib/vstaricon.png -Xms800m -Xmx1500m -jar ./dist/vstar.jar

and with the change:

bash -x VStar.sh 
++ dirname VStar.sh
+ APP_DIR=.
++ uname -a
++ grep 64
+ VER='Darwin meeus-2.local 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:53:19 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6020 arm64'
+ '[' 'Darwin meeus-2.local 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:53:19 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6020 arm64' '!=' '' ']'
++ echo darwin22
++ grep darwin
+ '[' darwin22 '!=' '' ']'
+++ sysctl -n hw.memsize
++ perl -e 'print int(34359738368 / (1024*1024*1024) / 2);'
+ HALF_MEM=16
+ '[' 16 == '' ']'
+ '[' 16 == 0 ']'
+ MAX_MEM=16g
+ java -splash:./extlib/vstaricon.png -Xms800m -Xmx16g -jar ./dist/vstar.jar