Interface JvmOptionBag
- All Superinterfaces:
org.jvnet.hk2.config.ConfigBeanProxy
- All Known Subinterfaces:
JavaConfig,Profiler
public interface JvmOptionBag
extends org.jvnet.hk2.config.ConfigBeanProxy
Factored out the list of jvm-options from at least two other interfaces that have them:
java-config and profiler.
Similar to PropertyBag.
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleandefault StringgetStartingWith(String start) default intSee #getXmxMegs.default intIt's observed that many a time we need the value of max heap size.voidsetJvmOptions(List<String> options) static intMethods inherited from interface org.jvnet.hk2.config.ConfigBeanProxy
createChild, deepCopy, getParent, getParent
-
Method Details
-
getJvmOptions
-
setJvmOptions
- Throws:
PropertyVetoException
-
getXmxMegs
default int getXmxMegs()It's observed that many a time we need the value of max heap size. This is useful when deciding if a user is misconfiguring the JVM by specifying-Xmxthat is smaller than-Xms. Sun's JVM for example, bails out withIncompatible minimum and maximum heap sizes specifiedwhen that happens. It's generally better to do some basic validations in those cases and that's when this method may be useful.Note: It does not take defaults into account. Also, I have tested that server does not start with a heap that is less than 1m, so I think I don't have to worry about -Xmx that is specified to be less than 1 MB. Again, there is lots and lots of platform dependent code here, so this check should be minimal. Again, I am doing this kind of check here because while testing, I was able to get into a situation where -Xmx is configured smaller than -Xms and the server won't start. The user then must edit the domain.xml by hand!
- Returns:
- an integer specifying the actual max heap memory (
-Xmx) configured. If it's specified as-Xmx2g, then2*1024i.e.2048is returned. Returns-1if no-Xmxis specified.
-
getXmsMegs
default int getXmsMegs()See #getXmxMegs.- Returns:
- integer specifying
-Xmsin megabytes, or-1
-
contains
-
getStartingWith
-
toMeg
-