News for hackers. Stuff that matters.
Re:Introducing Play 2.0 by jshen on Wednesday September 07, 2011 @10:25AM (#2969584)
My biggest problem with jvm web stuff is that it uses so much ram for simple little web apps. For someone that likes to make small web apps for fun, I can't fit more than one jvm app on my little vps. Anyone know how to get the memory down on these things?
Re:Introducing Play 2.0 by eropple on Wednesday September 07, 2011 @10:31AM (#2969607)
My answer, and no it's probably not what you want to hear, is one of two things:

-Get a bigger VPS

-Build bigger applications.

There is a lot of overhead in the JVM (CLR too). It's pretty much unavoidable in the Java ecosystem. That said, that overhead remains relatively constant even as you write significantly bigger pieces of software, so after a certain point it tends to matter a lot less.

Re:Introducing Play 2.0 by ssmoot on Wednesday September 07, 2011 @02:13PM (#2970681)
Just to re-inforce this: While the initial memory spike can seem pretty unreasonable coming from a site with a couple Mongrels or something, converting to JRuby from a Unicorn site using 16 workers and over 2GB of RAM is very nice. You end up using a lot less RAM and support a lot more connections.
Re:Introducing Play 2.0 by jshen on Wednesday September 07, 2011 @02:35PM (#2970775)
yeah, it's definitely great once you reach a certain traffic level. I imagine you either get a ton of traffic, or you're site is very dynamic to require 16 workers. I cache a lot of pages so many requests do not hit the rails stack at all.

But this is what I love about the ruby world, we get both options :)

Re:Introducing Play 2.0 by jshen on Wednesday September 07, 2011 @12:18PM (#2970108)
I've opted for the third option, use C ruby. I use JRuby at work and love the JVM in that context, I just wish I could use it for my fun side projects :(

PS - using ruby and having both options is pretty awesome.

Re:Introducing Play 2.0 by dminor on Wednesday September 07, 2011 @10:41AM (#2969644)
You can set the minimum and maximum heap size using -Xms and -Xmx, e.g. -Xmx512M will limit the heap to 512 MB.
Re:Introducing Play 2.0 by jshen on Wednesday September 07, 2011 @10:44AM (#2969660)
yeah, but I can't get it to run below 100mb for the whole process. heap is around 30mb, perm gen around 25mb, then another 50 somewhere.
Re:Introducing Play 2.0 by naaman on Wednesday September 07, 2011 @01:04PM (#2970317)
heroku has support for play, though it's not 2.0 yet. a free account might be a good workaround to your vps.
Re:Introducing Play 2.0 by jshen on Wednesday September 07, 2011 @01:07PM (#2970338)
heroku is far more expensive if you have any amount of data, or if you need a background worker. I run 3 rails sites, with background jobs, a search engine (sphinx), etc. All on a $30/month vps, and they run great.