Examples of MemoryMonitor


Examples of org.apache.batik.util.gui.MemoryMonitor

     */
    public class MonitorAction extends AbstractAction {
        public MonitorAction() {}
        public void actionPerformed(ActionEvent e) {
            if (memoryMonitorFrame == null) {
                memoryMonitorFrame = new MemoryMonitor();
                Rectangle fr = getBounds();
                Dimension md = memoryMonitorFrame.getSize();
                memoryMonitorFrame.setLocation(fr.x + (fr.width  - md.width) / 2,
                                               fr.y + (fr.height - md.height) / 2);
            }
View Full Code Here

Examples of org.apache.flex.forks.batik.util.gui.MemoryMonitor

     */
    public class MonitorAction extends AbstractAction {
        public MonitorAction() {}
        public void actionPerformed(ActionEvent e) {
            if (memoryMonitorFrame == null) {
                memoryMonitorFrame = new MemoryMonitor();
                Rectangle fr = getBounds();
                Dimension md = memoryMonitorFrame.getSize();
                memoryMonitorFrame.setLocation(fr.x + (fr.width  - md.width) / 2,
                                               fr.y + (fr.height - md.height) / 2);
            }
View Full Code Here

Examples of org.contikios.cooja.MoteMemory.MemoryMonitor

  private MemoryMonitor memMonitor;

  public IPAddress(final Mote mote) {
    moteMem = mote.getMemory();

    memMonitor = new MemoryMonitor() {
      public void memoryChanged(MoteMemory memory, MemoryEventType type, int address) {
        if (type != MemoryEventType.WRITE) {
          return;
        }
        setChanged();
View Full Code Here

Examples of org.contikios.cooja.MoteMemory.MemoryMonitor

  private MemoryMonitor memMonitor = null;

  public RimeAddress(final Mote mote) {
    moteMem = mote.getMemory();
    if (hasRimeAddress()) {
      memMonitor = new MemoryMonitor() {
        public void memoryChanged(MoteMemory memory, MemoryEventType type, int address) {
          if (type != MemoryEventType.WRITE) {
            return;
          }
          setChanged();
View Full Code Here

Examples of org.jamesii.gui.application.MemoryMonitor

    tm.setPreferredSize(new Dimension(450, prefSize.height));
    tm.setMaximumSize(tm.getPreferredSize());
    hBox.add(Box.createHorizontalGlue());
    hBox.add(tm);
    hBox.add(Box.createHorizontalStrut(5));
    hBox.add(new MemoryMonitor());

    return hBox;
  }
View Full Code Here

Examples of org.jvnet.hudson.MemoryMonitor

    /**
     * Obtains the string that represents the architecture.
     */
    private static class MonitorTask implements Callable<MemoryUsage,IOException> {
        public MemoryUsage call() throws IOException {
            MemoryMonitor mm;
            try {
                mm = MemoryMonitor.get();
            } catch (IOException e) {
                if(!warned) {
                    // report the problem just once, and avoid filling up the log with the same error. see HUDSON-2194.
                    warned = true;
                    throw e;
                } else {
                    return null;
                }
            }
            return new MemoryUsage2(mm.monitor());
        }
View Full Code Here

Examples of org.jvnet.hudson.MemoryMonitor

    /**
     * Obtains the string that represents the architecture.
     */
    private static class MonitorTask implements Callable<MemoryUsage,IOException> {
        public MemoryUsage call() throws IOException {
            MemoryMonitor mm;
            try {
                mm = MemoryMonitor.get();
            } catch (IOException e) {
                if(!warned) {
                    // report the problem just once, and avoid filling up the log with the same error. see HUDSON-2194.
                    warned = true;
                    throw e;
                } else {
                    return null;
                }
            }
            return new MemoryUsage2(mm.monitor());
        }
View Full Code Here

Examples of se.sics.cooja.MoteMemory.MemoryMonitor

  private MemoryMonitor memMonitor;

  public IPAddress(final Mote mote) {
    moteMem = mote.getMemory();

    memMonitor = new MemoryMonitor() {
      public void memoryChanged(MoteMemory memory, MemoryEventType type, int address) {
        if (type != MemoryEventType.WRITE) {
          return;
        }
        setChanged();
View Full Code Here

Examples of se.sics.cooja.MoteMemory.MemoryMonitor

  private MemoryMonitor memMonitor = null;

  public RimeAddress(final Mote mote) {
    moteMem = mote.getMemory();
    if (hasRimeAddress()) {
      memMonitor = new MemoryMonitor() {
        public void memoryChanged(MoteMemory memory, MemoryEventType type, int address) {
          if (type != MemoryEventType.WRITE) {
            return;
          }
          setChanged();
View Full Code Here

Examples of uk.ac.uea.threadr.internal.MemoryMonitor

    threadr.setOutputLevel(Level.FINEST);
    threadr.setSequentialHandler(new PostSequentialHandler());

    for (int i = 1; i <= TASK_COUNT; i++) {

      MemoryMonitor monitor = MemoryMonitor.getInstance();

      List<Long> seqs = new ArrayList<>();
      List<Long> pars = new ArrayList<>();
      List<Long> thrs = new ArrayList<>();
      List<Float> impsPar = new ArrayList<>();
      List<Float> impsThr = new ArrayList<>();
      List<Double> seqMemUse = new ArrayList<>();
      List<Double> thrMemUse = new ArrayList<>();
      List<Double> parMemUse = new ArrayList<>();

      ThreadrTest[] test = new ThreadrTest[i];
      for (int j = 0; j < i; j++) {
        test[j] = new ThreadrTest();
      }

      Test2[] test2 = new Test2[i];
      for (int j = 0; j < i; j++) {
        test2[j] = new Test2();
      }

      ThreadrTest[] test3 = new ThreadrTest[i];
      for (int j = 0; j < i; j++) {
        test3[j] = new ThreadrTest();
      }

      /* Save the generated tests. */
      saveTest("test1", test);
      saveTest("test2", test2);
      saveTest("test3", test3);

      System.out.println("\n------------------------------");
      System.out.printf("Test number - %d;\n", i);
      System.out.printf("Repetitions - %d;\n", REPS);
      System.out.printf("Tasks per test - %d;\n", i);

      for (int j = 0; j < REPS;) {
        /* Load the saved state of the parallelism test. */
        test = (ThreadrTest[]) loadTests("test1");
        /* Load the saved state of the threading test. */
        test2 = (Test2[]) loadTests("test2");
        /* Load the saved state of the sequential test. */
        test3 = (ThreadrTest[]) loadTests("test3");

        long startTime, endTime, diff1, diff2, diff3;
       
        /* Start the memory monitor. */
        Thread monitorThread = new Thread(monitor);
        monitorThread.start();
        System.gc();
        /* Run the sequential tests. */
        startTime = System.currentTimeMillis();
        for (ThreadrTest t : test3) {
          Threadr.logger.finer(t.toString());
          AbstractReturnType<?> result = t.call();
          Threadr.logger.finer(result.toString());
        }
        endTime = System.currentTimeMillis();
        /* Stop the memory monitor. */
        try {
          monitorThread.join();
        } catch (InterruptedException e) {
          e.printStackTrace();
        }
        seqMemUse.add(monitor.getMaxUsedMemory(MemoryUnits.MEGABYTE));
        diff1 = endTime - startTime;
        seqs.add(diff1);
        Threadr.logger.fine(String.format(
            "\tNon-threaded tasks execution time %dms\n", diff1));

        /* Test parallel executions. */
        System.gc();
        threadr.reset();
        threadr.addTasks(test);
        for (ThreadrTest t : test) {
          Threadr.logger.finer(t.toString());
        }
        startTime = System.currentTimeMillis();
        ThreadrResult results = threadr.execute();
        endTime = System.currentTimeMillis();
        diff2 = endTime - startTime;
        pars.add(diff2);
        double totalMem = threadr.getMemoryMonitor().getMaxUsedMemory(MemoryUnits.MEGABYTE);
        /* Get all the MemoryMonitors out from the results. */
        for (AbstractReturnType<?> result : results.getResults()) {
          /*
           * If the monitors are different, we must be looking at
           * another VM.
           */
          MemoryMonitor resultMon = (MemoryMonitor) result.getResult();
          if (!result.getResult().equals(threadr.getMemoryMonitor())) {
            totalMem += resultMon.getMaxUsedMemory(MemoryUnits.MEGABYTE);
          }
        }
        parMemUse.add(totalMem);
        Threadr.logger
            .fine(String
                .format("\nVirtual Machine tasks execution time %dms\n",
                    diff2));

        for (AbstractReturnType<?> result : results.getResults()) {
          Threadr.logger.finer(result.toString());
        }
        /* Work out the percentage increase in execution speed. */
        float percentage = (((float) (diff1 - diff2) / (float) diff1) * 100.0f);
        impsPar.add(percentage);
        Threadr.logger.fine(String.format(
            "\tImprovement: %03.02f%% \n", percentage));

        /* Set up and test threaded executions. */
        System.gc();
        threadr.reset();
        threadr.addTasks(test2);
        for (Test2 t : test2) {
          Threadr.logger.finer(t.toString());
        }
        startTime = System.currentTimeMillis();
        results = threadr.execute();
        endTime = System.currentTimeMillis();
        diff3 = endTime - startTime;
        thrs.add(diff3);
        totalMem = threadr.getMemoryMonitor().getMaxUsedMemory(MemoryUnits.MEGABYTE);
        for (AbstractReturnType<?> result : results.getResults()) {
          MemoryMonitor resultMon = (MemoryMonitor) result
              .getResult();
          if (!result.getResult().equals(threadr.getMemoryMonitor())) {
            totalMem += resultMon.getMaxUsedMemory(MemoryUnits.MEGABYTE);
          }
        }
        thrMemUse.add(totalMem);
        Threadr.logger.fine(String.format(
            "\tThreaded tasks execution time %dms\n", diff2));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.