Ejemplo n.º 1
0
  /** print out some info about the system and JVM etc. */
  public static void show() {
    Properties prop = System.getProperties();

    JDDConsole.out.println(
        "Using JDD build " + jdd.Version.build + " on " + (new Date()).toString() + "\n");
    JDDConsole.out.print(
        "Using " + prop.getProperty("java.vendor") + " JRE " + prop.getProperty("java.version"));
    String jit = prop.getProperty("java.compiler");
    if (jit != null) JDDConsole.out.print(", " + jit + " JIT in");
    JDDConsole.out.println(" " + prop.getProperty("java.vm.name"));

    JDDConsole.out.println(
        "OS "
            + prop.getProperty("os.name")
            + " on "
            + rt.availableProcessors()
            + " "
            + prop.getProperty("os.arch")
            + " CPU(s)");
    JDDConsole.out.print("Total JRE memory: ");
    Digits.printNumber1024(rt.maxMemory());
    JDDConsole.out.print(", memory currently reserved by the JRE: ");
    Digits.printNumber1024(usedMemory());
    JDDConsole.out.println("\n");
  }
Ejemplo n.º 2
0
  public void showStats(String type) {
    if (numaccess != 0) {
      JDDConsole.out.print(type + "-cache ");
      JDDConsole.out.print("ld=" + computeLoadFactor() + "% ");
      JDDConsole.out.print("sz=");
      Digits.printNumber(cache_size);

      JDDConsole.out.print("accs=");
      Digits.printNumber(numaccess);
      JDDConsole.out.print("clrs=" + numclears + "/" + numpartial_clears + " ");

      JDDConsole.out.print("hitr=" + computeHitRate() + "% ");
      if (numgrows > 0) {
        JDDConsole.out.print("grws=" + numgrows + " ");
      }

      showDeviation();
      JDDConsole.out.println();
    }
  }
Ejemplo n.º 3
0
  public Cache(int size, int members) {
    Test.check(members >= 1, "Cache members must be greater than 0");
    Test.check(members <= 3, "Cache members must be less than 4");

    cache_bits = (size < 32) ? 5 : Digits.closest_log2(size); // min size 32
    cache_size = (1 << cache_bits);
    cache_mask = cache_size - 1;
    this.members = members;
    numgrows = 0;
    last_access = numaccess = 0;
    possible_bins_count = 0;
    numclears = numpartial_clears = 0;

    entries = new CacheEntry[cache_size];
    for (int i = 0; i < cache_size; i++) {
      entries[i] = new CacheEntry();
    }
  }