Skip to content

Commit

Permalink
Fixed #1968, #1971, #1957 Cannot start FFDec due to large stack size …
Browse files Browse the repository at this point in the history
…on some configurations

Changed #1957 Larger stack size (when needed) must be configured manually in ffdec.bat or ffdec.sh
  • Loading branch information
jindrapetrik committed Feb 12, 2023
1 parent 876ef22 commit f468c60
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ All notable changes to this project will be documented in this file.
- [#1964] Freezing on releasing mouse while shape transforming (deadlock)
- [#1961] Characters can use characterId 0, PlaceObject can use depth 0
- [#1963] Reading CLIPEVENTFLAGS ClipActionEndFlag on SWF versions >= 6
- [#1968], [#1971], [#1957] Cannot start FFDec due to large stack size on some configurations

### Changed
- [#1960] Quick search does not search in SWF name or folder names
- [#1961] SoundStreamHead on main timeline is exported/imported with identifier "-1"
- [#1957] Larger stack size (when needed) must be configured manually in ffdec.bat or ffdec.sh

## [18.3.4] - 2023-01-30
### Added
Expand Down Expand Up @@ -2948,6 +2950,8 @@ All notable changes to this project will be documented in this file.
[#1964]: https://www.free-decompiler.com/flash/issues/1964
[#1961]: https://www.free-decompiler.com/flash/issues/1961
[#1963]: https://www.free-decompiler.com/flash/issues/1963
[#1968]: https://www.free-decompiler.com/flash/issues/1968
[#1971]: https://www.free-decompiler.com/flash/issues/1971
[#1029]: https://www.free-decompiler.com/flash/issues/1029
[#1948]: https://www.free-decompiler.com/flash/issues/1948
[#1941]: https://www.free-decompiler.com/flash/issues/1941
Expand Down
4 changes: 2 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
<maxHeapPercent>${max.heap.size.percent}</maxHeapPercent>
<opt>-Xss${max.stack.size}m</opt>
<!-- <opt>-Xss${max.stack.size}m</opt> -->
<opt>-Djava.net.preferIPv4Stack=true</opt>
<opt>-Djna.nosys=true</opt>
</jre>
Expand Down Expand Up @@ -696,7 +696,7 @@
<java jar="${dist.dir}/${jar.filename}.jar" fork="true">
<env key="VLC_VERBOSE" value="-1" />
<jvmarg value="-Xmx${max.heap.size.run}m" />
<jvmarg value="-Xss${max.stack.size}m"/>
<!-- <jvmarg value="-Xss${max.stack.size}m"/> -->
<jvmarg value="-Djava.net.preferIPv4Stack=true" />
<arg line="${run.params}" />
</java>
Expand Down
12 changes: 9 additions & 3 deletions resources/ffdec.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
@echo off
rem This is a comment, it starts with "rem".

rem Set following 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 following to higher value when you encounter StackOverFlowErrors
set STACK_SIZE=32m
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 Hide VLC error output
set VLC_VERBOSE=-1

java -Xmx%MEMORY% -Xss%STACK_SIZE% -Djna.nosys=true -jar "%~dp0\ffdec.jar" %*
if not "%STACK_SiZE%"=="" set STACK_SIZE_PARAM= -Xss%STACK_SiZE%
if not "%MEMORY%"=="" set MEMORY_PARAM=-Xmx%MEMORY%

java %MEMORY_PARAM%%STACK_SIZE_PARAM%-Djna.nosys=true -jar "%~dp0\ffdec.jar" %*
16 changes: 13 additions & 3 deletions resources/ffdec.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#!/usr/bin/env bash

# This is a comment, it starts with "#".

# Set following 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

# Set following to higher value when you encounter StackOverFlowErrors
STACK_SIZE=32m
# Uncomment following when you encounter StackOverFlowErrors.
# If the app then terminates with OutOfMemory you can experiment with lower value.
# STACK_SIZE=32m

# Hide VLC error output
export VLC_VERBOSE=-1
Expand Down Expand Up @@ -77,7 +80,14 @@ fi

popd > /dev/null

args=(-Djava.net.preferIPv4Stack=true -Xmx$MEMORY -Xss$STACK_SIZE -jar $JAR_FILE "$@")
if [ -n "$STACK_SIZE" ]; then
STACK_SIZE_PARAM=" -Xss$STACK_SIZE"
fi
if [ -n "$MEMORY" ]; then
MEMORY_PARAM=" -Xmx$MEMORY"
fi

args=(-Djava.net.preferIPv4Stack=true${MEMORY_PARAM}${STACK_SIZE_PARAM} -jar $JAR_FILE "$@")

if [ "`uname`" = "Darwin" ]; then
args=(-Xdock:name=FFDec -Xdock:icon=icon.png "${args[@]}")
Expand Down

0 comments on commit f468c60

Please sign in to comment.