possible in case of errors to help R D personnel troubleshoot on-site problems. The Java virtual machine provides the parameter-XX: + HeapDumpOnOutOfMemoryError, which can be used to export the entire heap information when the memory overflows. It also works with-XX: HeapDumpPath to specify the storage path of the exported heap.
[Example 3-4] the following cod
Heap MemoryThe heap in Java is the largest memory space managed by the JVM and is primarily used to store instance objects of various classes.In Java, the heap is divided into two different areas: the New Generation (young), the old generation (older). The New Generation (yo
, you need to get as much field information as possible in the event of an error, in order to help the developers to troubleshoot the site problem. The Java Virtual machine provides the parameter-xx:+heapdumponoutofmemoryerror, which allows you to export the entire heap information when memory overflows. In conjunction with-xx:heapdumppath, you can specify a storage path for the exported
occurrence of such errors, you need to get as much field information as possible in the event of an error, in order to help the developers to troubleshoot the site problem. The Java Virtual machine provides the parameter-xx:+heapdumponoutofmemoryerror, which allows you to export the entire heap information when memory overflows. In conjunction with-xx:heapdumppath, you can specify a storage path for the ex
1) Java heap
All object instances are allocated with memory on the Java stack. The heap size is adjusted by-Xmx and-Xms, as shown in the following sample:
[Java]Public class HeapOOM {Static class OOMObject {}/*** @ Param args*/Public static void main (String [] args ){List W
, and when you actually encounter Oom, you can locate the memory overflow in which area according to the exception information.You can add a parameter-xx:+heapdumponoutmemoryerror to let the virtual machine dump the current memory heap dump snapshot for post-mortem analysis when a memory overflow exception occurs.Familiar with the
When viewing the mat document, this describes the shallow heap: shallowheap is the memory consumed by one object. An object needs + or (depending on the OS architecture) per reference, 4 bytes per Integer, 8 bytesper Long, etc. Depending on the heap dump format the size is adjusted (e.g.aligned to 8, etc ...) to model better the real consumption of the VM.Accordi
When there is a heapdumponoutofmemoryerror error, we need to analyze the reason, the following program is to simulate this error and export the dump file, so that you analyzeGctest.java PackageGC; Public classGctest {Private Static Final int_1mb= 1024 * 1024;//approx. 1m Public Static voidMain (string[] args) {//a total of about 8m, heap size set not more than 8388608B that is 8.388608m memory
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.