The memory graph Shared by the method
Phone类
package com.itheima_03;
/*
* 手机类
*/
public class Phone {
String brand;
int price;
String color; public void call(String name) {
System.out.println("给"+name+"打电话");
} public void sendMessage() {
System.out.println("群发短信");
}
}
手机的测试类
package com.itheima_03;
/*
* 手机类的测试类
*/
public class PhoneDemo2 {
public static void main(String[] args) {
Phone p = new Phone();
p.brand = "小米5s";
p.price = 1999;
p.color = "银色";
System.out.println(p.brand+"---"+p.price+"---"+p.color);
p.call("林青霞");
p.sendMessage(); Phone p2 = new Phone();
p2.brand = "IPhone7S";
p2.price = 7999;
p2.color = "土豪金";
System.out.println(p2.brand+"---"+p2.price+"---"+p2.color);
p2.call("张曼玉");
p2.sendMessage();
}
}
内存图:
main方法执行完毕后,002 003的指向也就没有了,等到垃圾回收器空闲的时候,就会来回收再堆内存的这些垃圾了。
The memory graph Shared by the method的更多相关文章
- Xcode8的调试技能Memory Graph 实战解决闭包引用循环问题
Xcode8的调试技能又增加了一个黑科技:Memory Graph.简单的说就是可以在运行时将内存中的对象生成一张图. 那么通过一个实际项目来练习一下吧. 首先我们写了一个自定义UIView:MyVi ...
- [React] Stop Memory Leaks with componentWillUnmount Lifecycle Method in React
In this lesson we'll take a stopwatch component we built in another lesson and identify and fix a me ...
- System and method to prioritize large memory page allocation in virtualized systems
The prioritization of large memory page mapping is a function of the access bits in the L1 page tabl ...
- GPU编程--Shared Memory(4)
GPU的内存按照所属对象大致分为三类:线程独有的.block共享的.全局共享的.细分的话,包含global, local, shared, constant, and texture memoey, ...
- CUDA ---- Shared Memory
CUDA SHARED MEMORY shared memory在之前的博文有些介绍,这部分会专门讲解其内容.在global Memory部分,数据对齐和连续是很重要的话题,当使用L1的时候,对齐问题 ...
- 【并行计算-CUDA开发】CUDA shared memory bank 冲突
CUDA SHARED MEMORY shared memory在之前的博文有些介绍,这部分会专门讲解其内容.在global Memory部分,数据对齐和连续是很重要的话题,当使用L1的时候,对齐问题 ...
- 【DSP开发】shared memory VS mailbox
Hello, Hi everyone, I have a simple question. Could anyone explain to me the difference between Mail ...
- Paper: A Novel Time Series Forecasting Method Based on Fuzzy Visibility Graph
Problem define a fuzzy visibility graph (undirected weighted graph), then give a new similarity meas ...
- 程序间数据共享与传递:EXPORT/IMPORT、SAP/ABAP Memory
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
随机推荐
- bzoj3956: Count (单调栈+st表)
题面链接 bzoj 题解 非常巧妙的一道题 类似[hnoi影魔] 每个点会给左右第一个大于它的点对产生贡献 可以用单调栈求出 这里有点小细节,就是处理相等的点时,最左边的点管左边的贡献,最右边的点管最 ...
- js 实现星级评分
最近的项目中有一个星级评分的需求, 自己就写了一下, 由于可能一个页面要用到多个,就采用了面向对象的写法. 用到的png图片也放到这里. js要用到jquery. css: .sr-star{ ...
- Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting
解决方法: find / -name supervisor.sock unlink /name/supervisor.sock 2. www-data 用户是干什么用的 3.如何通过superviso ...
- 【编程技术-Shell】AWK使用大全
1. AWK中输出特殊字符 输出单引号 涉及到转义字符,但是在使用普通的方法进行转义时,会遇到下面的问题 正确的方法:'\'',使用单引号将转义字符括起来,然后后面加上单引号 输出其他特殊字符 输出 ...
- window.name实现跨域
在 http://www.cnblogs.com/zhuzhenwei918/p/6759459.html 这篇文章中,我提到了几种跨域的方式,这里主要讲解使用window.name实现跨域. 跨域就 ...
- python实现RSA加密解密方法
python3.5 安装pip 安装rsa python -m pip install rsa 我们可以生成RSA公钥和密钥,也可以load一个.pem文件进来 # -*- coding: utf-8 ...
- 14.Promise对象
1.Promise的含义 Promise 是异步编程的一种解决方案,比传统的解决方案——回调函数和事件——更合理和更强大.它由社区最早提出和实现,ES6将其写进了语言标准,统一了用法,原生提供了Pro ...
- Can't find the 'libpq-fe.h header when trying to install pg gem
https://stackoverflow.com/questions/6040583/cant-find-the-libpq-fe-h-header-when-trying-to-install-p ...
- MYSQL数据库的参数文件
参数文件:告诉MySQL实例启动时在哪里可以找到数据库文件,并且指定某些初始化参数,这些参数定义了某种内存结构的大小等设置,还会介绍各种参数的类型. 参数文件 当MySQL实例启动时,MySQL会先去 ...
- [转载]二叉树(BST,AVT,RBT)
二叉查找树(Binary Search Tree)是满足如下性质的二叉树:①若它的左子树非空,则左子树上所有结点的值均小于根结点的值:②若它的右子树非空,则右子树上所有结点的值均大于根结点的值:③左. ...