Class VMStartupParameters


  • public class VMStartupParameters
    extends Object
    VMStartupParameters. Reads or replaces certain VM startup parameters for the next VM start.
    Author:
    Hendrik Schreiber
    • Constructor Detail

      • VMStartupParameters

        public VMStartupParameters​(int minHeapMB,
                                   int maxHeapMB,
                                   int maxDirectMB,
                                   Preferences preferences,
                                   String windowsEnvironmentVariableName,
                                   Preferences macJVMOptions)
        Parameters:
        minHeapMB - min heap memory in megabytes
        maxHeapMB - max heap memory in megabytes
        maxDirectMB - max direct memory in megabytes
        preferences - preferences to read and write values to/from
        windowsEnvironmentVariableName - environment variable for Windows, e.g. BEATUNES_MEMORY, to write to (may be honored by launcher)
        macJVMOptions - preferences object to store values in for macOS (may be honored by launcher)
      • VMStartupParameters

        public VMStartupParameters()
        Creates standard instance for beaTunes.
    • Method Detail

      • writePreferencesToConfigFile

        public void writePreferencesToConfigFile()
                                          throws IOException
        Throws:
        IOException
      • writePreferences

        public void writePreferences()
      • getMemoryHeapMax

        public String getMemoryHeapMax()
      • getMemoryHeapMaxInMegaBytes

        public int getMemoryHeapMaxInMegaBytes()
      • setMemoryHeapMax

        public void setMemoryHeapMax​(String memoryHeapMax)
      • getMemoryHeapMin

        public String getMemoryHeapMin()
      • getMemoryHeapMinInMegaBytes

        public int getMemoryHeapMinInMegaBytes()
      • setMemoryHeapMin

        public void setMemoryHeapMin​(String memoryHeapMin)
      • getMemoryDirectMax

        public String getMemoryDirectMax()
      • setMemoryDirectMax

        public void setMemoryDirectMax​(String memoryDirectMax)
      • write

        public void write()
                   throws IOException
        Export the current values to either a Windows environment variable or macOS preferences.
        Throws:
        IOException - if the export fails
      • read

        public void read()
                  throws IOException
        Read the memory settings that are set in this running JVM.
        Throws:
        IOException - if we cannot read the current settings
      • getMemoryConfiguration

        public String getMemoryConfiguration()