In this Rails application, 'Cucumber' tests for different web-portals are invoked every scheduled interval using 'derailed_cuke' and then the test results are processed and saved in a MySQL database.
#for MySQL ActiveRecord
#with JRuby version 1.5.5
- After starting Rails Server and waiting for some non-specific time, an exception started arising mentioning ActiveRecord and an Heap OutOfMemory Exception being raised.
- I checked for my database services, schema & content; all was as expected and even working fine from 'rails console'.
- My bad old debug-style... the first thing I did was inserted 'print STATUS_MSG' at all suspected locations for ActiveRecord.
- It worked :), and the location sorted out was the place where cucumber-tests' processed results was saved in database.
- So now, 'Cucumber' was under suspicion radar... I google-d over recent incidents including both 'OutOfMemory Exception' and 'Cucumber', and there were few blogposts about similar problem of 'memory leakage' in Cucumber.
in my JRubyOnRails appication (one of the major benefit of using JRuby).
- So, I started tweaking the Cucumber test's schedule interval to a higher and lower value.
This clearly showed it's impact over the Memory Profiling by JConsole and the relativity of duration in which the Exception was being raised.
Until the Cucumber flaw is corrected, the work-around used was pushing in some more RAM
 using JVM Parameters to increase the Heap Size used by Rails application
#jruby -J-Xmx2500m -J-Xms2500m -J-Xmn512m -S rails s
-J-Xmx2500m ~ means maximum Java Heap Size increased to 2500m
-J-Xms2500m ~ means initial Java Heap Size increased to 2500m
-J-Xmn2500m ~ means eden Java Heap Size increased to 500m
for server-side applications, Xmx & Xms is preferred to be kept same