SomMeri / less4j

Less language is an extension of css and less4j compiles it into regular css. Less adds several dynamic features into css: variables, expressions, nested rules, and so on. Less was designed to be compatible with css and any correct css file is also correct less file.
145 stars 47 forks source link

Resident in memory objects #357

Open casph opened 7 years ago

casph commented 7 years ago

I've an application running in a tomcat 6 container thats compiles some less files runtime when required by the user.

Using jProfile after compile (see code below), i've noticed that less4j keeps many static objects in memory.

jprofile-less

LessSource lessSource = new LessSource.FileSource(file, "UTF-8");

Map<String, String> vars = new HashMap<>();
vars.put("@context", "\"" + req.getContextPath() + "\"");

LessCompiler compiler = new ThreadUnsafeLessCompiler();

Configuration configuration = new Configuration();
configuration.setCompressing(true);
configuration.addExternalVariables(vars);

CompilationResult result = compiler.compile(source, configuration);
result.getCss();

Static object remains always in memory, how can i free them?

Thanks, Phaedra.

casph commented 7 years ago

No one have noticed this behaviour?