Package mondrian.util

Class MemoryMonitorTest

    • Field Detail

      • enabled

        protected boolean enabled
    • Constructor Detail

      • MemoryMonitorTest

        public MemoryMonitorTest()
      • MemoryMonitorTest

        public MemoryMonitorTest​(java.lang.String name)
    • Method Detail

      • convertThresholdToPercentage

        protected static int convertThresholdToPercentage​(long threshold,
                                                          long maxMemory)
      • causeGC

        public boolean causeGC​(MemoryMonitor mm)
        Get the difference between the maximum memory and the used memory and divide that by 1000. This is the size of allocation chunks. Keep allocating chunks until an OutOfMemoryError is created.
      • setUp

        protected void setUp()
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • tearDown

        protected void tearDown()
                         throws java.lang.Exception
        Overrides:
        tearDown in class FoodMartTestCase
        Throws:
        java.lang.Exception
      • testDeltaUsage

        public void testDeltaUsage()
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • _testQuery

        public void _testQuery()
                        throws java.lang.Exception
        Run this by itself and it works across 2 orders of magnitude. Run it with other tests and its hard to pick the right values for the percentage and how much to allocate for it to always work.
        Throws:
        java.lang.Exception