2 Replies Latest reply on Apr 18, 2012 5:27 PM by 931231

    Why are there je.maxMemoryPercent and je.maxMemory?

    931231
      What might be the reason to have two properties (namely je.maxMemoryPercent and je.maxMemory) to set one thing, namely the size of the cache?

      Would it not be better to have just one property like

      je.maxMemory = 60% ; wanna have 60 percent of max heap reserved for cache memory

      je.maxMemory = 20MB ; wanna have a fixed size of 20MB (also supported: TB, GB, KB and B).

      je.maxMemory = 20000000 ; throws InvalidArgumentException (ambiguous value, neither fish nor flesh).

      And the pro side I count:
      * only one property to watch
      * no such thing as which property wins when both are set
      * very easy to grasp and easy to read (in comparison with je.maxMemory = 29876634334343 => how many MB are this??????)

      On the "cons" side I'm counting .. nothing.
        • 1. Re: Why are there je.maxMemoryPercent and je.maxMemory?
          Greybird-Oracle
          You have a point, but since the values are type Java long, it isn't something either easy to change, or high priority.
          --mark                                                                                                                                                                                                                                                           
          • 2. Re: Why are there je.maxMemoryPercent and je.maxMemory?
            931231
            greybird wrote:
            You have a point, but since the values are type Java long, it isn't something either easy to change, or high priority.
            --mark
            Well, all configuration parameters could be passed as Strings and internally parsed into appropriate long values. Meaning, the current "long" configuration methods would be marked as deprecated (and visibility changed to protected in an upcoming major release).

            Then all configuration parameters could be corralled into an "enum" and a single additional method would be introduced, namely

            setConfigValue(PARAMETER parameter, String value) throws InvalidArgumentException
            greybird wrote:
            High priority,
            Well, yes, sigh :-)))