M1

mikeyhu70

Member
Joined
Nov 20, 2021
Posts
12
Likes
4
if it's not against the rule and anyone that want it, I can zip the final app and upload somewhere if anyone want to test it outside trading hours
 

lthiers

Member
Joined
Oct 31, 2020
Posts
11
Likes
1
if it's not against the rule and anyone that want it, I can zip the final app and upload somewhere if anyone want to test it outside trading hours
Hello dear, I am new to trading but using heavy studies and already compared M1 to old MBP and did find some improvement. But Replay mode is same - due to the way these studies are developed. Your effort should be appreciated by the Mac community. I could save time next year to try your work. Huge memory savings should translate to better user experience somehow.
 

JoshS

Active member
Joined
Jul 26, 2021
Posts
43
Likes
15
The memory footprint is way smaller, before it was like 4GB, now it's under 1GB with the same chart open

My assumption is javafx native it did not load others rosetta library

I always use those flags to make Java snappier in every Java apps, even IB or TOS

-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=25 -XX:G1HeapRegionSize=32M
Thanks for providing these! I gave it a shot and my motivewave wouldn't startup -- might be that these aren't compatible with all versions. (I'm on latest MW with Monteray.) Thankfully just need to edit the settings ini file to swap back and be able to open again. Heads up for others -- your mileage may vary. (file is in your Users/<username>/Library/Motivewave folder.)
 

mikeyhu70

Member
Joined
Nov 20, 2021
Posts
12
Likes
4
it depends if you run manually the file /Applications/MotiveWave.app/Contents/MacOS/run.sh what error it gives? I backup the original file and edited with

but before I set my java stuff in a different directory

I'm on the latest of MW and Monterey 12.1

But one thing it never works is Rithmic because the library is 32 bit (i.e libRithmic.jnilib)

Have been using this for 2 months without any issue, basically set java to the macos-arm (both javafx and java)and modify a few line in run.sh

The parameter in NW I ignore it as I force it with java switch


#!/bin/bash
# strip /MacOS/run.sh off of the fully qualified script name (ie arg 0)
SCRIPTDIR="$( cd "$(dirname "$0")" ; pwd -P )" # Full path to script
BASEDIR=`dirname "${SCRIPTDIR}"` # Directory script is run in
APPDIR=`dirname "${BASEDIR}"` # Directory script is run in
FXDIR="$BASEDIR/javafx".arm64
CP=""
for entry in "$BASEDIR/Java/"*.jar
do
CP+=":$entry"
done
# trim the first ':'
CP=$(echo $CP| cut -c 2-)

# Pull information from the startup.ini file in the motivewave directory
SETTINGS_FILE=$HOME/Library/MotiveWave/startup.ini
VM_ARGS=""
MAX_HEAP=""
MAX_VRAM="2048M"
if test -f "$SETTINGS_FILE"; then
# Ignore comments '#'
LINES=`grep -v '^#' $SETTINGS_FILE `
IFS=$'\n'
for LINE in $LINES
do
IFS='='
read -r N V <<< "$LINE"
V="${V##*( )}"
if [[ $N = "MAX_HEAP" && $V != "" ]]; then MAX_HEAP="-Xmx$V"; fi
if [[ $N = "MAX_VRAM" && $V != "" ]]; then MAX_VRAM="$V"; fi
if [[ $N = "SCALE" && $V != "" ]]; then SCALE="$V"; fi
if [[ $N = "VM_ARGS" ]]; then VM_ARGS="$V"; fi
done
IFS=''

if [[ $MAX_HEAP != "" || $VM_ARGS != "" ]]; then
echo "Reading Startup Options from: $SETTINGS_FILE"
echo "Max Heap: $MAX_HEAP"
echo "VM Args: $VM_ARGS"
fi
fi

if [[ $MAX_VRAM == "" ]]; then MAX_VRAM="2048M"; fi

echo "Max Heap: $MAX_HEAP"
echo "Max VRAM: $MAX_VRAM"
echo "VM Args: $VM_ARGS"

JAVADIR="$BASEDIR/Plugins/Java.runtime/Contents.arm64/Home/bin/java"

"$JAVADIR" -version

"$JAVADIR" -Xmx8192m -Xms2048m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=25 -XX:G1HeapRegionSize=32M $MAX_HEAP $VM_ARGS -javaagent:"$BASEDIR/Java/MotiveWave.jar" -Dname="MotiveWave" -Xdock:name="MotiveWave" -Xdock:icon="$BASEDIR/Resources/icon.icns" -Djava.library.path="$SCRIPTDIR" -DUserHome="$HOME" -Duser.dir="$HOME" -DappDir="$APPDIR" -DLibraryDirectory="$HOME/Library" -DDocumentsDirectory="$HOME/Documents" -DCachesDirectory="$HOME/Library/Caches" -DApplicationDirectory="$HOME/Applications" -DDesktopDirectory="$HOME/Desktop" -DDownloadsDirectory="$HOME/Downloads" -DSharedPublicDirectory="$HOME/Public" -DSystemLibraryDirectory=/Library -DSystemCachesDirectory=/Library/Caches -DSystemApplicationDirectory=/Applications -DSystemUserDirectory=/Users -Dprism.verbose=true -Dprism.maxvram=$MAX_VRAM -p "$FXDIR" --add-modules=javafx.controls,javafx.base,javafx.graphics,javafx.media,javafx.web,javafx.swing --add-exports javafx.web/com.sun.webkit.network=ALL-UNNAMED -classpath "$CP" MotiveWave
 

lthiers

Member
Joined
Oct 31, 2020
Posts
11
Likes
1
The memory footprint is way smaller, before it was like 4GB, now it's under 1GB with the same chart open

My assumption is javafx native it did not load others rosetta library

I always use those flags to make Java snappier in every Java apps, even IB or TOS

-XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=25 -XX:G1HeapRegionSize=32M
hello I have gotten a Mac mini M1 and installed latest motive wave . I have also downloaded as per your hints a more recent version of java
so these are the 2 output:

unmodified MW Contents:
flatlolo@flatlolos-Mini / % ./Applications/MotiveWave\ copy.app/Contents/MacOS/run.sh
Max Heap:
Max VRAM: 2048M
VM Args:
openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode)
...

modified MW Contents following mikeyhu70 hints
flatlolo@flatlolos-Mini /Applications % ./MotiveWave.app/Contents/MacOS/run.sh
Max Heap:
Max VRAM: 2048M
VM Args:
openjdk version "17.0.2" 2022-01-18 LTS
OpenJDK Runtime Environment Zulu17.32+13-CA (build 17.0.2+8-LTS)
OpenJDK 64-Bit Server VM Zulu17.32+13-CA (build 17.0.2+8-LTS, mixed mode, sharing)

...

I haven't yet tested during trading hours (I use IB) but it would be great if you could document how you measured RAM consumption ?
with top ? ps -ef | grep java ?

big thanks...
 
Last edited:
Top