Open n0samu opened 1 year ago
FFDEC sets it own memory limit in the .bat file Maybe Ruffle can do the same thing
That actually gave me an idea. I've created a .bat file that runs Ruffle and automatically terminates it if it uses more than 4GB of memory. Here's the code:
@ECHO off
SET RUST_LOG=warn,ruffle_core=debug,avm_trace=trace
START ruffle-win64\ruffle.exe %*
:MemCheck
taskkill /f /fi "memusage gt 4000000" /im ruffle.exe > NUL
timeout 1 > NUL
GOTO MemCheck
As a bonus, the command window also shows the Ruffle warnings/errors and the trace statements from the SWF.
As for the original enhancement request, maybe the simple-process-stats crate could be used for this? https://crates.io/crates/simple-process-stats
Stunt Pilot 2 has a similar memory issue.
Describe the feature Attempting to use too much memory can cause system instability, crashes and other extreme unpleasantness, especially in the desktop app. Right now Ruffle has nothing in place to mitigate these problems. Ruffle should have some configurable memory usage limit, and automatically terminate if it exceeds the limit.
Here is an example SWF that uses extremely excessive memory and causes my computer to crash: homesheephome2.zip