When you start and run the application running on the JVM, you should be able to configure things like heap size and shift space, which should affect the amount of memory. If you need to write in Java or Groovy or Jython or JRuby or Scala, see how this can be configured for your application.
Yes, JVM languages are known for memory consumption, such as 8-byte overhead for objects and the need for padding, which cause Integer objects to require much more memory than you might think (see somewhere :)). However, the JVM offers many advantages: most JVMs have been tuned and optimized by really smart people over the past 15 years (can you write a garbage collector, which is good?). And the Java platform is just huge. He has it all.
Are your 10 scripts long-term and should be permanent in memory at the same time? Or do they work fast? Since you already wrote them in Bash, it looks like you don't need a rich Java platform. Are you just moving files around and carving and grepping and awking and sedding?
I usually like Bash for small scripts, but as soon as I get to the point where I have loops or two and a few variables (basically something related to logic other than the if statement), Ruby and Python start searching is much easier to read and maintain. Groovy is not necessarily a bad choice (although other languages are more popular). But as far as memory issues are concerned, you should take the time to try to configure JVM-based applications and take some measurements. In your situation, this may not matter much. Perhaps the start time of the JVM plays a factor? Much depends on your specific situation.
source share