Module: JVMArgs::Rules
- Defined in:
- lib/jvmargs/heaprules.rb
Class Method Summary collapse
Class Method Details
.heap_too_big(key = "Xmx", args) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/jvmargs/heaprules.rb', line 4 def self.heap_too_big(key="Xmx",args) total_ram = JVMArgs::Util.get_raw_num(JVMArgs::Util.get_system_ram_m) new_ram = JVMArgs::Util.get_raw_num(args[:nonstandard][key].value) if new_ram > total_ram raise ArgumentError, "You can't set #{key} to larger than the available system RAM of #{total_ram}" end end |
.max_smaller_than_min(key = "Xmx", args) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/jvmargs/heaprules.rb', line 12 def self.max_smaller_than_min(key="Xmx",args) if args[:nonstandard]["Xms"].nil? return else max_heap = JVMArgs::Util.get_raw_num(args[:nonstandard]["Xmx"].value) min_heap = JVMArgs::Util.get_raw_num(args[:nonstandard]["Xms"].value) if max_heap < min_heap raise ArgumentError, "Max heap size #{max_heap}M cannot be smaller than Minimum heap size #{min_heap}M" end end end |