Closed sameerarora closed 9 years ago
JMustache is not designed for one-pass operation over large files. It parses the entire file into memory and keeps the contents in memory, and generates output from the in-memory parsed representation.
A 600MB file is going to probably double in size because Java converts bytes into 16-bit chars for in-memory representation, so you can probably do what you need if you give Java a big max heap size, but otherwise JMustache is probably not the right tool for this job.
Reader in=new InputStreamReader(new FileInputStream(new File("/Users/sameerarora/dependencies.txt"))); Mustache.compiler().escapeHTML(true).compile(in);
The above code throws an OutOfMemory error if the file is bigger than a certain size. I tried with a file of size 600 MB. I am using jMustache version 1.9.