I'm trying to read a very big file(more than 1G) in a dart program, but it throws out of memory exception.
How do I configure the command line to make it run with a bigger memory? Just like:
-Xmx1G
in Java.
The dart run command supports running a Dart program — located in a file, in the current package, or in one of the dependencies of the current package — from the command line. This command provides functionality that was previously in pub run and the Dart VM tool.
This creates a folder named playground with a Dart project inside. 1. Create a new folder 2. Add a dart file with a main () function 3. Run the app If your app has dependencies... 4. Setup configuration name: playground description: Just a place to practice version: 0.0.1 dependencies: crypto: ^2.0.6 5. Get dependencies
This process fills RAM at a speed of ~150 MB per second. Note that usually exists several processes dart.exe, but only one of them for some reason eats all the RAM.
console-full - A command-line application sample. package-simple - A starting point for Dart libraries or applications. server-shelf - A web server built using the shelf package. web-angular - A web app with material design components. web-simple - A web app that uses only core Dart libraries.
The VM has a flag to increase the heap size: --old_gen_heap_size
. For example --old_gen_heap_size=1024
would set it to 1GB.
This flag is among the developer-flags and is not considered stable. It could change or go away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With