From 0a5eaa102fde6ae35843020cf9edfd316fcaab5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Mon, 20 Nov 2023 18:44:00 +0100 Subject: [PATCH] Added MEMORY and STACK_SIZE parameters now can be set via external variables FFDEC_MEMORY, FFDEC_STACK_SIZE --- CHANGELOG.md | 2 ++ resources/ffdec.bat | 14 ++++++++------ resources/ffdec.sh | 20 +++++++++++++------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a032a522c..6e5469bbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file. - [#2119] Option to export assets with names like their assigned classes via SymbolClass, without character id - [#2119] Bulk imported assets can also match filenames based on assigned classname, not just character id prefix - Debugger shows (logs) unhandled exceptions +- [#2129] MEMORY and STACK_SIZE parameters now can be set via external variables FFDEC_MEMORY, FFDEC_STACK_SIZE ### Fixed - [#2021], [#2000] Caret position in editors when using tabs and / or unicode @@ -3296,6 +3297,7 @@ Major version of SWF to XML export changed to 2. [#2100]: https://www.free-decompiler.com/flash/issues/2100 [#2123]: https://www.free-decompiler.com/flash/issues/2123 [#2119]: https://www.free-decompiler.com/flash/issues/2119 +[#2129]: https://www.free-decompiler.com/flash/issues/2129 [#2021]: https://www.free-decompiler.com/flash/issues/2021 [#2000]: https://www.free-decompiler.com/flash/issues/2000 [#2116]: https://www.free-decompiler.com/flash/issues/2116 diff --git a/resources/ffdec.bat b/resources/ffdec.bat index 6f7312e72..eecf0d798 100644 --- a/resources/ffdec.bat +++ b/resources/ffdec.bat @@ -1,18 +1,20 @@ @echo off rem This is a comment, it starts with "rem". -rem Set following to higher value if you want more memory: +rem Uncomment following and set it to higher value if you want more memory: rem You need 64 bit OS and 64 bit java to set it to higher values -set MEMORY=1024m +rem set FFDEC_MEMORY=1024m rem Uncomment following when you encounter StackOverFlowErrors. rem If the app then terminates with OutOfMemory you can experiment with lower value. -rem set STACK_SIZE=32m +rem set FFDEC_STACK_SIZE=32m rem Hide VLC error output set VLC_VERBOSE=-1 -if not "%STACK_SiZE%"=="" set STACK_SIZE_PARAM= -Xss%STACK_SiZE% -if not "%MEMORY%"=="" set MEMORY_PARAM=-Xmx%MEMORY% +set STACK_SIZE_PARAM= +set MEMORY_PARAM= +if not "%FFDEC_STACK_SiZE%"=="" set STACK_SIZE_PARAM= -Xss%FFDEC_STACK_SiZE% +if not "%FFDEC_MEMORY%"=="" set MEMORY_PARAM=-Xmx%FFDEC_MEMORY% -java %MEMORY_PARAM%%STACK_SIZE_PARAM%-Djna.nosys=true -jar "%~dp0\ffdec.jar" %* \ No newline at end of file +echo %MEMORY_PARAM%%STACK_SIZE_PARAM%-Djna.nosys=true -jar "%~dp0\ffdec.jar" %* diff --git a/resources/ffdec.sh b/resources/ffdec.sh index 025524f5b..6d055695b 100644 --- a/resources/ffdec.sh +++ b/resources/ffdec.sh @@ -2,13 +2,13 @@ # This is a comment, it starts with "#". -# Set following to higher value if you want more memory +# Uncomment following and set it to higher value if you want more memory # You need 64 bit OS and 64 bit java to set it to higher values -MEMORY=1024m +# FFDEC_MEMORY=1024m # Uncomment following when you encounter StackOverFlowErrors. # If the app then terminates with OutOfMemory you can experiment with lower value. -# STACK_SIZE=32m +# FFDEC_STACK_SIZE=32m # Hide VLC error output export VLC_VERBOSE=-1 @@ -80,11 +80,17 @@ fi popd > /dev/null -if [ -n "$STACK_SIZE" ]; then - STACK_SIZE_PARAM=" -Xss$STACK_SIZE" +if [ -z ${FFDEC_MEMORY+x} ]; then + FFDEC_MEMORY=1024m fi -if [ -n "$MEMORY" ]; then - MEMORY_PARAM=" -Xmx$MEMORY" + +STACK_SIZE_PARAM="" +MEMORY_PARAM="" +if [ -n "$FFDEC_STACK_SIZE" ]; then + STACK_SIZE_PARAM=" -Xss$FFDEC_STACK_SIZE" +fi +if [ -n "$FFDEC_MEMORY" ]; then + MEMORY_PARAM=" -Xmx$FFDEC_MEMORY" fi args=(-Djava.net.preferIPv4Stack=true${MEMORY_PARAM}${STACK_SIZE_PARAM} -jar $JAR_FILE "$@")