In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article shows you the JVM Log technology principle and usage is what, the content is concise and easy to understand, absolutely can make you shine, through the detailed introduction of this article I hope you can gain something.
The implementation of each class of JVM Log not only naturally uses inheritance, but also effectively encapsulates the creation and release functions of JVM Log by using the C++ specific technique of overloading new/deleteoperator.
JVM Log Introduction
In debug versions of JVM, hotspot.JVM Log is output. Set GC's JVM Log with the parameter-XJVM Loggc:FileName.
JVM Log is implemented primarily in
\hotspot\src\share\vm\utilities\ostream.hpp \hotspot\src\share\vm\utilities\ostream.cpp \hotspot\src\share\vm\utilities\xmlstream.hpp \hotspot\src\share\vm\utilities\xmlstream.cpp \hotspot\src\share\vm\utilities\defaultStream.hpp
The main classes are: outputStream, fileStream, xmlTextStream, defaultStream
Inheritance relationships are:
ResourceObj
|
|-- outputStream
|
|--- fileStream
|
|--- xmlTextStream
|
|--- defaultStream
defaultStream::instance is the primary interface invoked by other modules.
Initialization of JVM Log
ostream_init() initializes defaultStream::instance
ostream_init_JVM Log() initializes JVM Debug Log and JVM Log for GC,
The core code is: defaultStream::instance->has_JVM Log_file(); it calls voiddefaultStream::init_JVM Log() instead; this is the code that really works.
defaultStream::init_JVM Log code is written very clearly, there is only one C++ syntax point to note: overloaded newoperator.
ostream.cppline346
fileStream*file=new(ResourceObj::C_HEAP)fileStream(try_name);
This is because the parent class of outputStream is ResourceObj, which overloads new and deleteoperator. Not much to say about C++ syntax, there are too many good books on the subject.
Final release of JVM Log
Threads::destroy_vm()
|
|--> exit_globals()
|
|--> ostream_exit()
|
|--> Release each JVM Log with delete operator
The implementation of each class of JVM Log not only naturally uses inheritance, but also effectively encapsulates the creation and release functions of JVM Log by using the C++ specific technique of overloading new/deleteoperator.
The above content is the JVM Log technology principle and usage is what, you have learned knowledge or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.