Fork me on GitHub

I usually search words 'fail' and 'error' in terminal search


it jumps me directly to errors without scrolling


seems a good-enough solution, thanks!


lein test :only is a good query as well (as it will point to the ns which is what I primarily seek)


Hello we have a clj back end with a 400 MB size. This back end uses 1.1GB RAM on our Heroku server, so we need a large dyno tu run the app. Has anybody faced a similar problem? Are there known ways to reduce the RAM burden on Heroku of clj apps? thanks for any answer!


What does 400MB represent? RAM, jar size?


@vemv is the size of the codebase in github


so if I git clone the repo it will weigh 400MB? seems fishy (or an incorrect measurement)


thats the only info i have now…


where are you based?




nice to meet and thanks



👍 8

it also includes all git data?


Did you try to limit the maximum heap size?


> -Xmx size in bytes Sets the maximum size to which the Java heap can grow. The default size is 64M. (The -server flag increases the default size to 128M.) The maximum heap limit is about 2 GB (2048MB).Aug 16, 2018


Hi @kirill.salykin i will ask our developer


im not a technical person, so i just know that this app creates a heavy RAM burden on heroku


I actually do not think there is a direct correlation between repo size and ram usage


yes thats probably right


but we compared repo of same size and different languages (example node.js) and the RAM consumption of our CLJ app was 5 times


stretching heroku server


@sufaber not an expert on optimization/etc, but I'd say clojure is simply memory-hungry. It easily takes 4GB+ RAM for development (not so much in production fortunately) that said 1.1GB is nothing (considering how production workloads can take terabytes of RAM these days), so if you're being charged too much for 1.1, consider yourself being ripped off 🙂 instead of spending eng effort in RAM optimization, switching languages, etc I'd switch from Heroku -> AWS Beanstalk, it gives you a similar experience for a lower cost (Heroku uses AWS after all)


@vemv thanks, unfortunately we have already invested time in Heroku(


Not to be too annoying, but beware of the sunk cost fallacy 🙂 with a bit of luck AWS Beanstalk could be adopted in say, one day, and the investment could last years. Has been the case for me


heroku has dyno at 50 usd month ( 1 GB) and next step is 4GB RAM (250$ month)…


this is the reason why im trying to understand if anyone had the same issue before


You should try -Xmx, but use a JVM profiler either way. Usual first suspects for ram blowup are (faulty) memoization and holding the head of lazy sequences.


Some JVMs in some runtime environments with some runtime settings try to grab a big chunk of available RAM. You need to understand your workload to tune the GC subsystem to balance RAM usage against your performance needs.


You should try -Xmx, but use a JVM profiler either way. Usual first suspects for ram blowup are (faulty) memoization and holding the head of lazy sequences.


Is a write/read roundtrip possible with re-pattern? (edn/read-string (pr-str #".*Apache License, Version 2\.0.*")) yields an error: RuntimeException No dispatch macro for: " clojure.lang.Util.runtimeException (


it's not part of the spec, you can create a tagged element to wrap it tho


#yourapp/rx "...." and have it return the value passed though re-pattern


something like that: (clojure.edn/read-string {:readers {'app/rx re-pattern}} "#app/rx \".*\"" )


@sufaber I guess most people developing on the JVM have experienced memory hungry applications. The solution to this is to profile your application and see which objects use that much memory and try to optimize that. There is not much more to say here as this is usually an individual solution. Also having 400 MB in your repo sounds like your storing your dependencies in git, which is not idiomatic at all, but thats just a guess. Correlating between the repo size and the memory usage on the other hand is just plain wrong, this is not a useful metric in any way.

👍 4

I could create you easily a repo containing a few kb that will use up all the ram in the world.


Wow this looks cool, thanks for sharing

👍 4

hello, is there a built in way to ns-qualify an expression while not qualifying what should not be qualified (like fn argv or let left bindings) ?


(fn [a]
  (let [b c]
    (d e b a)))

;; =>

    [b me/c]
    (me/d me/e b a)))


sounds like syntax quoting to me!


user=> `(fn [~'a] (let [b ~'c] (~'d ~'e b a)))
(clojure.core/fn [a] (clojure.core/let [user/b c] (d e user/b user/a)))


you have to manually un-quote the things that you don’t want namespaced though


@U3L6TFEJF thank you, i know how to do it by hand, i would like a generic way

Alex Miller (Clojure team)15:09:21

resolve might also be useful to you

Alex Miller (Clojure team)15:09:04

user=> (resolve 'foo)
user=> (resolve '+)


@alexmiller thank you, i will play with it and see what i can do


if you want to do this in a generic way that works for all clojure code you’ve got quite some work to do, but if you just want to handle special cases (like fn/let) it should be doable


@U3L6TFEJF thank you it will help i'm sure, also @alexmiller advice of using resolve seems to be powerful! it seems to do the trick 🙂


is there an equivalent tool for the clj cli tool for lein-less?


Ah, sorry that's kind of what I meant. You'd have to make your own deep learning algos/etc.

🍹 4

neanderthal for what it is, is damn amazing

🍺 4

+ Bayadera 🙂


Is there documentation that lists all of the options that can be included in a deps.edn file for use with the clj and clojure cli tools? In particular, i'm trying to write a more advanced :alias field, and there seems to be some hidden features in here that I would love to try out

Alex Miller (Clojure team)18:09:12

in alias, all of the supported options are doc’ed on the reference page

Alex Miller (Clojure team)18:09:32

that set being :extra-deps, :override-deps, :default-deps, :extra-paths, :classpath-overrides, :jvm-opts, and :main-opts


Ah ok, I wasn't reading it correctly, I had a warped idea on what it could be used for. So it provides more general aliasing of everything

Alex Miller (Clojure team)18:09:49

there is one undocumented, unsupported, use at your own risk, I do not promise it will continue to exist or do what it does now option which is :verbose


I guess that's for more output, so far i've been liking the direction of the tool

Alex Miller (Clojure team)18:09:03

there are definitely some under or undocumented keys in coordinates and top-level config

Alex Miller (Clojure team)18:09:18

eventually I will get around to fixing that


speaking of :jvm-opts... -add-modules disabled in Java10?


@alexmiller is there something equivalent to leiningen's do command, where you can run several things at once, or are you encouraged to write your own scripts to handle each case?


wouldn't you be outside the scope of the clj tool if you are doing anything other than resolving deps and starting a repl?

Alex Miller (Clojure team)19:09:45

no - clj is about a) making classpaths and b) running programs. Any Clojure code can be a program and that program might do anything!

Alex Miller (Clojure team)19:09:16

you run scripts (pass the .clj path) or mains (-m) or use stdin (-)


OK, that's fair

Alex Miller (Clojure team)19:09:15

in other words, builds are programs (boot got that right), but dependencies are data (lein did that better)


Interesting point, it would be interesting to see developments on some sort of build tool like gulp to use clj under the hood


I was just following the figwheel.main tutorial, and it seems to use clj directly, so I assumed the direction of the tool was something akin to gulp for clojure


oh wow, there's already a ton of tools


@benzap also don’t forget that you can just use -e “(user/start-server)” which would go pretty darn far


and of course there is --init script_name.clj


nice! I'll give it a shot


Understanding this tool more, it seems like a good direction, since you're just wrapping scripts and progressively configuring your build. Leads to a lot less confusion

👍 4