Beispiel #1
0
  /*
    ---------------------------
    Mimic Clojure Code:
    ---------------------------
  (defn run-cool-down
    "Allow a little time to see if JVM garbage collects.
   This may not have any effect"
    []
    ;;;
    (println (*memory-usage*))
    (Thread/sleep 100)
    (println (*memory-usage*))
    (Thread/sleep 80))

    */
  public void runCoolDown() {
    try {
      System.out.println(SystemUtils.memoryUsage());
      Thread.sleep(100);
      System.out.println(SystemUtils.memoryUsage());
      Thread.sleep(80);
    } catch (InterruptedException e) {

    }
  }
Beispiel #2
0
  public void runTest2() {

    System.out.println("Running Test [now using linked list] " + SystemUtils.currentDate());
    System.out.println(SystemUtils.memoryUsage());

    new SimpleTime(new SimpleDoTimes(new Test3Times(), (int) 1)).execute();
    System.out.println(SystemUtils.memoryUsage());

    System.out.println("Larger Strings");
    new SimpleTime(new SimpleDoTimes(new Test4Times(), (int) 1)).execute();
    System.out.println(SystemUtils.memoryUsage());
  }
Beispiel #3
0
  public void runTest() {

    System.out.println("Running Test " + SystemUtils.currentDate());
    System.out.println(SystemUtils.memoryUsage());

    new SimpleTime(new SimpleDoTimes(new Test1Times(), SystemUtils.once)).execute();
    System.out.println(SystemUtils.memoryUsage());

    System.out.println("Larger Strings");
    new SimpleTime(new SimpleDoTimes(new Test2Times(), SystemUtils.once)).execute();
    System.out.println(SystemUtils.memoryUsage());
  }
Beispiel #4
0
  public void runTest3() {

    System.out.println("Running with hashmap, put");
    System.out.println(SystemUtils.memoryUsage());
    new SimpleTime(new SimpleDoTimes(new Test5Times(), SystemUtils.once)).execute();
    System.out.println(SystemUtils.memoryUsage());

    new SimpleTime(new SimpleDoTimes(new Test6Times(), SystemUtils.once)).execute();
    System.out.println(SystemUtils.memoryUsage());

    new SimpleTime(new SimpleDoTimes(new Test7Times(), SystemUtils.once)).execute();
    System.out.println(SystemUtils.memoryUsage());
  }