Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a dart program with big memory?

Tags:

memory

dart

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.

like image 404
Freewind Avatar asked Feb 03 '14 04:02

Freewind


People also ask

How do I run a DART program?

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.

How to create a playground for a DART project?

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

What is the speed of Dart Exe?

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.

What are the different types of Dart applications?

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.


1 Answers

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.

like image 142
Florian Loitsch Avatar answered Oct 25 '22 22:10

Florian Loitsch