Re: Prgram uses a lot of swap

2017-03-01 Thread Cecil Westerhof
2017-02-26 21:06 GMT+01:00 Thomas Heller : > To control the memory you can add :jvm-opts ["-Xmx512m"] to your > project.clj. It will set the max memory of the JVM to 512mb which should be > enough for your program. > ​With the help of /proc//status I found out that it can be

Re: Prgram uses a lot of swap

2017-02-27 Thread Gary Trakhman
I've had great luck with the G1 garbage collector when running lots of JVMs on a single (linux) box. It's different from the default by actually freeing memory back to the OS on a full collection, this would result in lower total memory use thus lower swapping when multiple JVMs are running. The

Re: Prgram uses a lot of swap

2017-02-27 Thread Thomas Heller
> > ​What is the best way to determine the right value for this? I remember > that in the past I had a lot of little Java​ > > ​programs running and got a much better performance by limiting memory > usage. > That is not an easy question to answer. If you make it too small your process may

Re: Prgram uses a lot of swap

2017-02-27 Thread Cecil Westerhof
2017-02-26 21:06 GMT+01:00 Thomas Heller : > Ideally you would run your program without lein, probably as an uberjar. > ​Going to look at that in the near future. ​ > But if you insist on lein you can do "lein trampoline run -m your.main/fn" > which will allow the lein

Re: Prgram uses a lot of swap

2017-02-27 Thread Cecil Westerhof
2017-02-27 14:37 GMT+01:00 Thomas Heller : > Last thing I can come up with is your environment variables or something > in your ~/.lein/* folder. Beyond that I'm out of ideas. > ​That was the problem. In .lein I had profiles.clj, which contained: { :repl {

Re: Prgram uses a lot of swap

2017-02-27 Thread Thomas Heller
Last thing I can come up with is your environment variables or something in your ~/.lein/* folder. Beyond that I'm out of ideas. On Monday, February 27, 2017 at 2:15:18 PM UTC+1, Cecil Westerhof wrote: > > 2017-02-27 13:57 GMT+01:00 Cecil Westerhof >: > >> Maybe you have

Re: Prgram uses a lot of swap

2017-02-27 Thread Cecil Westerhof
2017-02-27 13:57 GMT+01:00 Cecil Westerhof : > Maybe you have some other conflicting configuration somewhere that sets it >> explicitly to 4G? Usually no maximum is set and the JVM will automatically >> adjust it based on your system. >> > > ​Not that I know of, but I will

Re: Prgram uses a lot of swap

2017-02-27 Thread Cecil Westerhof
2017-02-27 7:59 GMT+01:00 Thomas Heller : > Maybe you are running an old version of leiningen? > ​Yes, I installed it a long time ago. It was 2.6.1. I updated it to 2.7.1 ​ > This might work although JVM_OPTS works fine for me as well > > :jvm-opts ^:replace ["-Xmx512m"]

Re: Prgram uses a lot of swap

2017-02-26 Thread Thomas Heller
Maybe you are running an old version of leiningen? This might work although JVM_OPTS works fine for me as well :jvm-opts ^:replace ["-Xmx512m"] Maybe you have some other conflicting configuration somewhere that sets it explicitly to 4G? Usually no maximum is set and the JVM will automatically

Re: Prgram uses a lot of swap

2017-02-26 Thread Cecil Westerhof
2017-02-26 21:59 GMT+01:00 Cecil Westerhof : > To control the memory you can add :jvm-opts ["-Xmx512m"] to your >> project.clj. It will set the max memory of the JVM to 512mb which should be >> enough for your program. >> > > ​Did not work either, but at the moment I use:

Re: Prgram uses a lot of swap

2017-02-26 Thread Cecil Westerhof
2017-02-26 21:06 GMT+01:00 Thomas Heller : > Ideally you would run your program without lein, probably as an uberjar. > ​I have to dive into that. A good excuse to start with Clojure again. ;-) ​ > But if you insist on lein you can do "lein trampoline run -m your.main/fn"

Re: Prgram uses a lot of swap

2017-02-26 Thread Thomas Heller
Ideally you would run your program without lein, probably as an uberjar. But if you insist on lein you can do "lein trampoline run -m your.main/fn" which will allow the lein process to exit after setting up your program leaving you with only one JVM. To control the memory you can add :jvm-opts

Re: Prgram uses a lot of swap

2017-02-25 Thread Cecil Westerhof
2017-02-24 15:07 GMT+01:00 Timothy Baldridge : > What are the JVM memory settings set at? And how much physical memory does > the box have? > ​My system has 16 GB of memory. I use ‘lein run’ and this results in the following process:

Re: Prgram uses a lot of swap

2017-02-24 Thread Timothy Baldridge
What are the JVM memory settings set at? And how much physical memory does the box have? Timothy -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are

Prgram uses a lot of swap

2017-02-24 Thread Cecil Westerhof
Some time ago a wrote a simple program. It uses the H2 database and seesaw. It mostly sits idle, but from time to time I use it to fetch info from the database. I start it with: lein run It uses up quite a bit of swap. It is now running for a little longer as a week. The lein run process uses