Skip to content

Instantly share code, notes, and snippets.

@joinr
Created July 19, 2023 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joinr/3967ece1c36284cfd35161b6f2d9b380 to your computer and use it in GitHub Desktop.
Save joinr/3967ece1c36284cfd35161b6f2d9b380 to your computer and use it in GitHub Desktop.
upated harmonikit project file
(require '[leiningen.core.utils :refer [get-os]])
(def JVMOPTS
"Per os jvm options. Options common to all cases go under
`:any`. Options specific to one OS go under the key returned by
`leiningen.core.eval/get-os` for that system. Temporarily disabled
options can be kept under `:disabled`."
{:any
["-Xms512m" "-Xmx1g" ; Minimum and maximum sizes of the heap
"-XX:MaxGCPauseMillis=20" ; Specify a target of 20ms for max gc pauses
"-XX:MaxNewSize=257m" ; Specify the max and min size of the new
"-XX:NewSize=256m" ; generation to be small
"-XX:+UseTLAB" ; Uses thread-local object allocation blocks. This
; improves concurrency by reducing contention on
; the shared heap lock.
"-XX:MaxTenuringThreshold=0"] ; Makes the full NewSize available to every NewGC
; cycle, and reduces the pause time by not
; evaluating tenured objects. Technically, this
; setting promotes all live objects to the older
; generation, rather than copying them.
:disabled
["-XX:ConcGCThreads=2" ; Use 2 threads with concurrent gc collections
"-XX:TieredCompilation" ; JVM7 - combine both client and server compilation
; strategies
"-XX:CompileThreshold=1" ; JIT each function after one execution
"-XX:+PrintGC" ; Print GC info to stdout
"-XX:+PrintGCDetails" ; - with details
"-XX:+PrintGCTimeStamps"]}) ; - and timestamps
(defn jvm-opts
"Return a complete vector of jvm-opts for the current os."
[] (let [os (get-os)]
(vec (set (concat (get JVMOPTS :any)
(get JVMOPTS os))))))
(defproject harmonikit "0.1.0-SNAPSHOT"
:description "An additive synth in Clojure using overtone"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
[overtone "0.10.6"]
[org.clojure/core.async "1.6.673"]]
:jvm-opts ^:replace ~(jvm-opts))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment