Git Product home page Git Product logo

Comments (11)

plexus avatar plexus commented on July 30, 2024

Hi, thanks for reporting!

The three processes are leiningen, the repl, and figwheel. You can bring it down to two by using lein trampoline repl. This will replace the leiningen process with the repl once it starts.

Unfortunately Figwheel can't be used as a library, which means we have to invoke it through leiningen, so that creates an extra JVM. See also #47.

Apart from that this behavior is indeed "normal", although 2GB seems like a lot. For me it's more around 500MB.

There are various flags to control or limit the amount of memory the JVM uses, you could experiment with those.

from chestnut.

honza avatar honza commented on July 30, 2024

Would you be willing to share some details about your setup? I'm having a hard time understanding why someone people have such low memory numbers...

from chestnut.

plexus avatar plexus commented on July 30, 2024

This is what I use

$  java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

$  lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.1 LTS
Release:        14.04
Codename:       trusty

$  lein --version
Leiningen 2.5.0 on Java 1.8.0_25 Java HotSpot(TM) 64-Bit Server VM

Not much special for the rest. ~/lein/profiles.clj only contains the cider-nrepl plugin. I'm not sure what else could be relevant here.

Is it only with chestnut projects that you have this? Maybe compare with some other configs to see what part is so memory hungry. So do a lein trampoline repl in an empty directory, or in a new project, compare memory before/after (run), do lein figwheel separately and see how that behaves, etc.

from chestnut.

honza avatar honza commented on July 30, 2024

Thank you for your help!

I have upgraded to JDK 1.8 and now my setup matches what you described (apart from the OS, of course).

A couple of notes:

  1. When using lein trampoline repl, I can't successfully execute the (browser-repl) call.
  2. When using the cider-nrepl middleware in my profile, I only get 2 java processes instead of 3 and save about 500mb of memory.

Yes, I have noticed this with other projects as well but this case was unfortunately especially bad.

Thanks again.

from chestnut.

plexus avatar plexus commented on July 30, 2024

Glad it's better now. It's good to know this is a pain point. I hope we can make it all work seemlessly in a single process eventually.

from chestnut.

bhauman avatar bhauman commented on July 30, 2024

I've been watching this and been thinking a lot about making a library thats executable from the repl.

from chestnut.

martinklepsch avatar martinklepsch commented on July 30, 2024

I think lively could be embedded in the process easily. You'd need to handle Clojurescript compilation on your own then though.

from chestnut.

plexus avatar plexus commented on July 30, 2024

@bhauman that would be absolutely fabulous!

@martinklepsch how does lively relate to figwheel? Are they completely separate implementations?

from chestnut.

martinklepsch avatar martinklepsch commented on July 30, 2024

@plexus They're separate. Lively only implements the pushing of new code to the the browser. And does not care about compiling Clojurescript.

from chestnut.

bhauman avatar bhauman commented on July 30, 2024

Just want to let you know that I just released lein-figwheel 0.2.0-SNAPSHOT and you can now launch the autobuilder/change server from the new figwheel-sidecar library.

https://github.com/bhauman/lein-figwheel/blob/master/sidecar/src/figwheel_sidecar/auto_builder.clj#L38

Unfortunately config options are not yet validated at this level. The config validation is all still up in the leiningen plugin.

from chestnut.

plexus avatar plexus commented on July 30, 2024

Thank you @bhauman , that's great news!

from chestnut.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.