Home  >  Article  >  Java  >  Detailed introduction to the heap area

Detailed introduction to the heap area

零下一度
零下一度Original
2017-06-10 15:06:362235browse

The following editor will bring you an article that discusses the Java heap area, method area and stack area in detail. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let's follow the editor and take a look. Heap area: only stores class objects, shared by threads; method area: also called static storage area, stores class files and static data, shared by threads; stack area: stores method local variables, basic type variable area , execution environment context, operation instruction area, threads are not shared; class A { private String a = “aa”; //a is in the heap area public boolean methodB() { String b = “bb”; //b is in the stack area final&a

1. Detailed introduction about the stack area

Detailed introduction to the heap area

# #Introduction: The editor below will bring you a detailed discussion of the Java heap area, method area and stack area. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let's follow the editor and take a look. Heap area: only stores class objects, shared by threads; method area: also called static storage area, stores class files and static data, shared by threads; stack area: stores method local variables, basic type variable area , execution environment context, operation instruction area, threads are not shared; class A {  private ...

2. A brief introduction to the heap area in java Code examples of , method area and stack area

Detailed introduction to the heap area

##Introduction: The editor below will bring you a This article discusses the Java heap area, method area and stack area in detail. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor to take a look

3.

Detailed explanation of several garbage collection principles in Java

Detailed introduction to the heap area

Introduction: In Java, except for basic types such as integers and references, all objects are allocated in the heap area instead of the stack area. This design eliminates the need for programmers to pay attention to the life cycle of variables, but at the cost of generating more garbage.

4.

Detailed introduction to the difference between Java stack and heap

Detailed introduction to the heap area##Introduction: This article mainly introduces relevant information about the difference between java stack and heap in detail. Friends in need can refer to

5.

java stack and heap Difference

Detailed introduction to the heap areaIntroduction: The difference between java stack and heap

6.

[PHP] Linked list data structure (singly linked list) php gets database data php displays database data php database inserts number

Introduction: data structure, php:[ PHP] Linked list data structure (singly linked list): Linked list: It is an ordered list, but it is stored dispersedly in memory. Using linked lists can solve problems like Joseph's problem, sorting problem, search problem, generalized list, single-way linked list, and doubly linked list. , the bottom layer of circular linked list PHP is C. When a program is running, the memory is divided into five areas (heap area, stack area, global area, constant area, code area). It is stipulated that: basic data types are generally placed in the stack area. Composite data types , such as objects, placed in the heap area Define a class Hero Define member attribute ranking $no Define member attribute name $name Define member attribute nickname $nickname

7.

PHP Advanced Features Base

Introduction: PHP advanced features basic PHP object area in memory: PHP object name and object storage location are different, this is exactly the same as Java, so you can apply it in the PHP object-oriented part Do it with java ideas. The object is stored in the heap and the object name is stored in the stack like other ordinary variables. Note that the object name itself is a reference to the object, that is, its value is actually the address of the object it points to, so you can change the object it points to

##8. Heap sort (php implementation)

Introduction: Basic steps of heap sort: 1: Form an unordered sequence into a heap. 2: Exchange the top element and the last element of the heap. After the exchange, the heap structure is destroyed and the heap is reset. The difference between the initialization heap and the reset heap after exchange is that when initializing the heap, the node position is adjusted starting from the last non-leaf node, while the reset after exchanging the top element of the heap only needs to adjust the position of the top element of the heap. ?ph

[Related Q&A recommendations]:

ios - Good afternoon everyone, how to check whether an object is in the heap or in the heap in xcode Stack area?

c++ - Basic questions about the heap area of ​​C language, I am a newbie who just learned C

The above is the detailed content of Detailed introduction to the heap area. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn