当前位置:网站首页>The difference between heap and stack
The difference between heap and stack
2022-07-05 04:55:00 【yaohuiyaoo】
1. What is stack?
Stack is an ordered memory array .
2. The stack can store the value of variables , The execution environment of the program , Parameters passed to method
3. Data can only be inserted and deleted from the top of the stack , Put the data on the top of the stack for stacking , Delete the data as out of stack
4. What is a heap
Disordered memory area of heap , It can be deposited and removed in any order , although Can save data , But it cannot be explicitly deleted .
Heap is different from stack
1. Stack can save code execution steps , The heap holds objects , Data etc.
2. The stack allocates memory space during compilation ; Heap allocates memory size according to program operation
3. The stack has the principle of first in, last out , And it is a continuous memory area ; The heap is disordered , A piece of discontinuous , Controlled and released by the user
边栏推荐
- [crampon game] MC tutorial - first day of survival
- 2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem
- [crampon programming] lintcode decoding Encyclopedia - 1100 strange printer
- 【acwing】240. food chain
- [crampon programming] lintcode decoding Encyclopedia - 872 termination process
- Reading and visualization of DICOM, MHD and raw files in medical imaging
- AutoCAD - window zoom
- 中国聚氨酯硬泡市场调研与投资预测报告(2022版)
- MySQL in-depth learning - index creation and deletion, index design principles, index failure scenarios, query optimization, index push down ICP
- Leetcode 222 number of nodes of complete binary tree
猜你喜欢
AutoCAD - isometric annotation
[groovy] closure (Introduction to closure class closure | this, owner, delegate member assignment and source code analysis)
Looking at Chinese science and technology from the Winter Olympics: what is the mystery of the high-speed camera that the whole people thank?
[groovy] closure (closure parameter binding | curry function | rcurry function | ncurry function | code example)
Minor spanning tree
A survey of automatic speech recognition (ASR) research
[groovy] closure (closure parameter list rule | default parameter list | do not receive parameters | receive custom parameters)
Emlog博客主题模板源码简约好看响应式
The principle of attention mechanism and its application in seq2seq (bahadanau attention)
MySQL in-depth learning - index creation and deletion, index design principles, index failure scenarios, query optimization, index push down ICP
随机推荐
C iterator
中国AS树脂市场调研与投资预测报告(2022版)
【acwing】240. food chain
用 Jmeter 工具做个小型压力测试
China needle coke industry development research and investment value report (2022 Edition)
This article is good
Establish cloth effect in 10 seconds
[groovy] closure (Introduction to closure class closure | this, owner, delegate member assignment and source code analysis)
PostgreSQL 超越 MySQL,“世界上最好的编程语言”薪水偏低
MySQL audit log Archive
Download the details and sequence of the original data access from the ENA database in EBI
SQLServer 存储过程传递数组参数
[crampon programming] lintcode decoding Encyclopedia - 1100 strange printer
[PCL self study: feature9] global aligned spatial distribution (GASD) descriptor (continuously updated)
AutoCAD - lengthening
54. 螺旋矩阵 & 59. 螺旋矩阵 II ●●
Solution of circular dependency
xss注入
3dsmax common commands
AutoCAD - full screen display