answersLogoWhite

0

You can use the following to find out the memory usage information for a Java Program:

  • Runtime.getRuntime().maxMemory()
  • Runtime.getRuntime().totalMemory()
  • Runtime.getRuntime().freeMemory()
User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

In java a class will take memory?

Yes, executing a Java class will require memory just like any other program.


What is java memory leak?

That means a memory leak in a program written in Java. A memory leak means that as the program runs, more and more memory is wasted - usually by being assigned and not de-assigned again. In Java this is not as usual as in other languages, since unused memory is normally reclaimed automatically by the garbage collector.


How do you make an antivirus program using Java?

A running java program only has access to the memory allocated to it by the Java Runtime Environment. Java by design does not allow access to absolute memory locations which is required to scan for memory resident viruses. A Java-based anti-virus program can still read a virus-signature file and use it to scan for those patterns in files to identify possible infected files.


What is a heap in Java and how does it function within the Java programming language?

In Java, a heap is a data structure used to store and manage objects dynamically allocated during program execution. It is a region of memory where objects are stored and accessed by the Java Virtual Machine (JVM). The heap is responsible for memory allocation and deallocation, allowing objects to be created and destroyed as needed. This helps manage memory efficiently and ensures that the program runs smoothly without running out of memory.


How is java reliable?

Java is robust because it is highly supported language, meaning that unlike C you cannot crash your computer with a bad program. Also, another factor in its robustness is its portability across many Operating systems, with is supported by the Java Virtual Machine.


What do you mean by multithread program in java?

A Program in Java that spawns multiple threads is called a multithreaded program in Java.


What is memory leak problemin java?

Memory leaks do not occur in Java as the garbage collector clears the memory which has no references.


Whether java heap exist in hard disk or ram?

Your Hard Disk is where programs and data are stored for later retrieval ( excluding virtual memory) . If a program is in execution it has to be loaded in the memory (by memory I mean the RAM), So your Java Heap has to be in the RAM and cannot reside on the Hard disk.


What is a Java Drive-By?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What is JAVA drive by?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What is a Java Drive By?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What is java program on computers?

#!/usr/bin/perl print 'java program';