内存分区:
1.栈区(stack):效率高,存放参数值,局部变量值,编译器自动分配并释放。栈的大小是2M。
2.堆区(heap):new alloc 程序自动管理,由程序员分配和释放程序释放后,操作系统自动回收。
3.静态区:全局变量和静态变量存储在一起,程序结束后由系统释放。
4.常量区:常量存储位置,不允许修改。
5.代码区:存放函数体的二进制代码。