Examples of MemoryProfiler


Examples of avrora.sim.util.MemoryProfiler

            if ( LOWER_ADDRESS.get() ) {
                memstart = 0;
            } else {
                memstart = BaseInterpreter.NUM_REGS + p.ioreg_size;
            }
            memprofile = new MemoryProfiler(ramsize);

            insertWatches();
        }
View Full Code Here

Examples of org.jboss.dashboard.profiler.memory.MemoryProfiler

    protected long startMemory;
    protected long startTime;

    public DataSetLoadConstraints(DataSet dataSet) {
        dataSetRef = new WeakReference<DataSet>(dataSet);
        MemoryProfiler memoryProfiler = MemoryProfiler.lookup().freeMemory();
        startMemory = memoryProfiler.getMemoryUsedInBytes();
        startTime = System.currentTimeMillis();
    }
View Full Code Here

Examples of org.jboss.dashboard.profiler.memory.MemoryProfiler

    public void validate() throws Exception {
        DataSet dataSet = dataSetRef.get();
        DataProvider dataProvider = dataSet.getDataProvider();
        if (dataProvider == null) return;

        MemoryProfiler memoryProfiler = MemoryProfiler.lookup().freeMemory();
        long memoryUsed = memoryProfiler.getMemoryUsedInBytes() - startMemory;
        long elapsedTime = System.currentTimeMillis() - startTime;
        long sizeInBytes = dataSet.sizeOf();
        long maxSize = dataProvider.getDataLoader().getMaxDataSetSizeInBytes();
        long maxTime = dataProvider.getDataLoader().getMaxDataSetLoadTimeInMillis();
        long maxMemUsed = dataProvider.getDataLoader().getMaxMemoryUsedInDataLoad();
View Full Code Here

Examples of org.jboss.dashboard.profiler.memory.MemoryProfiler

    @Inject
    private transient Logger log;

    public boolean processRequest() throws Exception {
        MemoryProfiler memoryProfiler = MemoryProfiler.lookup();
        if (memoryProfiler.isLowMemory()) {
            log.warn("Memory is running low ...");
            memoryProfiler.freeMemory();
            if (memoryProfiler.isLowMemory()) {
                RequestContext requestContext = RequestContext.lookup();
                requestContext.setResponse(new SendErrorResponse(503));
                requestContext.consumeURIPart(requestContext.getURIToBeConsumed());
                log.error("Memory is so low that the request had to be canceled - 503 sent. Consider increasing the JVM memory.");
                return false;
View Full Code Here

Examples of org.jboss.dashboard.profiler.memory.MemoryProfiler

public class FreeMemoryProcessor extends RequestChainProcessor {

    private static transient Logger log = LoggerFactory.getLogger(FreeMemoryProcessor.class.getName());

    protected boolean processRequest() throws Exception {
        MemoryProfiler memoryProfiler = MemoryProfiler.lookup();
        if (memoryProfiler.isLowMemory()) {
            log.warn("Memory is running low ...");
            memoryProfiler.freeMemory();
            if (memoryProfiler.isLowMemory()) {
                getControllerStatus().setResponse(new SendErrorResponse(503));
                getControllerStatus().consumeURIPart(getControllerStatus().getURIToBeConsumed());
                log.error("Memory is so low that the request had to be canceled - 503 sent. Consider increasing the JVM memory.");
                return false;
            }
View Full Code Here

Examples of org.jboss.dashboard.profiler.memory.MemoryProfiler

    protected long startMemory;
    protected long startTime;

    public DataSetLoadConstraints(DataSet dataSet) {
        dataSetRef = new WeakReference<DataSet>(dataSet);
        MemoryProfiler memoryProfiler = MemoryProfiler.lookup().freeMemory();
        startMemory = memoryProfiler.getMemoryUsedInBytes();
        startTime = System.currentTimeMillis();
    }
View Full Code Here

Examples of org.jboss.dashboard.profiler.memory.MemoryProfiler

    /**
     * @throws DataSetException In case any it doesn't meet the thresholds set.
     */
    public void validate() throws Exception {
        DataSet dataSet = dataSetRef.get();
        MemoryProfiler memoryProfiler = MemoryProfiler.lookup().freeMemory();
        long memoryUsed = memoryProfiler.getMemoryUsedInBytes() - startMemory;
        long elapsedTime = System.currentTimeMillis() - startTime;
        long sizeInBytes = dataSet.sizeOf();
        long maxSize = dataSet.getDataProvider().getDataLoader().getMaxDataSetSizeInBytes();
        long maxTime = dataSet.getDataProvider().getDataLoader().getMaxDataSetLoadTimeInMillis();
        long maxMemUsed = dataSet.getDataProvider().getDataLoader().getMaxMemoryUsedInDataLoad();
View Full Code Here

Examples of org.jboss.dashboard.profiler.memory.MemoryProfiler

    @Inject
    private transient Logger log;

    public boolean processRequest(CommandRequest request) throws Exception {
        MemoryProfiler memoryProfiler = MemoryProfiler.lookup();
        if (memoryProfiler.isLowMemory()) {
            log.warn("Memory is running low ...");
            memoryProfiler.freeMemory();
            if (memoryProfiler.isLowMemory()) {
                ControllerStatus controllerStatus = ControllerStatus.lookup();
                controllerStatus.setResponse(new SendErrorResponse(503));
                controllerStatus.consumeURIPart(controllerStatus.getURIToBeConsumed());
                log.error("Memory is so low that the request had to be canceled - 503 sent. Consider increasing the JVM memory.");
                return false;
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.