博客更新计划
该文档主要阐明后续的博客重点更新方向:
主题 | 进度 | 备注 |
---|---|---|
《二分》 | 规划中 | 二分查找、二分搜索,算法、理论与应用 |
《DFS、BFS》 | 编写中 | 总结DFS、BFS的通用思路,题解举例 |
《动态规划》 | 规划中 | 总结从递归到动态规划、题解 |
该文档主要阐明后续的博客重点更新方向:
主题 | 进度 | 备注 |
---|---|---|
《二分》 | 规划中 | 二分查找、二分搜索,算法、理论与应用 |
《DFS、BFS》 | 编写中 | 总结DFS、BFS的通用思路,题解举例 |
《动态规划》 | 规划中 | 总结从递归到动态规划、题解 |
Reference
This site is built by Vuepress, Vuepress GitHub
A basic tutorial: zero-to-deploy-build-a-documentation-system-with-vue-and-vuepress
Zon of Python By Tim Peters
translated by weigao chen
几种引用类型:
引用类型 | 功能特点 |
---|---|
强引用(Strong Reference) | 被强引用关联的对象永远不会被垃圾收集器回收掉 |
软引用(Soft Reference) | 软引用关联的对象,只有当系统将要发生内存溢出时,才会去回收软引用的对象 |
弱引用(Weak Reference) | 只被弱引用关联的对象,只要发生垃圾收集事件,就会被回收 |
虚引用(Phantom Reference) | 被虚引用关联的对象的唯一作用是能在这个对象被回收时收到一个系统通知 |
JVM 的软件架构如下:
JAVA 内存布局如下图所示:
通过对典型应用的 JVM 内存进行拆解,如下:
Total: reserved=15538605KB, committed=14221757KB
Java Heap (reserved=9601024KB, committed=9601024KB)
Class (reserved=2095827KB, committed=1215827KB)
Metadata (reserved=995328KB, committed=993536KB)
## 每个类的元数据:类名、方法、字段描述
Class space (reserved=1048576KB, committed=170368KB)
## 为类加载器存储的数据预留的空间
Thread (reserved=43505KB, committed=10101KB)
## 包括线程栈和线程本地存储
stack (reserved=43505KB, committed=10101KB)
## 对每个线程分配的栈空间,大小可通过 -Xss 配置
Code (reserved=977086KB, committed=573642KB) # 为 JIT 编译器预留的内存
GC (reserved=495136KB, committed=495136KB) # 为 GC 预留的内存
Compiler (reserved=734KB, committed=734KB)
Internal (reserved=20654KB, committed=20654KB) #JVM 内部使用的内存,依赖于 JVM 的实现
Other (reserved=733088KB, committed=733088KB)
## Native Memory Tracking, Arena Chunk, Logging,
## Arguments, Module,Synchronizer, Safepoint, Wisp, null
JAVA 字符串操作的优化。
Java Char Array | ||
---|---|---|
Head | Mark Word | 4 Bytes |
Class Pointer | 4 Bytes | |
Length of Array | Offset = 8 | |
Instance Data | Data of Array | |
Padding |
On the Advantages and Disadvantages of Marketing Strategy from the Perspective of Enterprise Development
With the rapid development of Internet economy, the marketing amount of enterprises has changed greatly. Over the past decade or so, we have witnessed many micro-enterprises achieve business success through excellent marketing strategies, and many enterprises have been abandoned by the times because of improper marketing. This paper selects several typical enterprises and their landmark marketing strategies to explain how marketing strategies become the key to enterprise success.
Pacel 是 IPC 通信中的序列化和反序列化类;
官方给出了 IPC 接口的使用方式,其中规定了 Parcel 相关的操作。
JS 侧的客户端在发送消息的时候需要按照如下的方式使用:
import rpc from "@ohos.rpc"
// 使用期约
let option = new rpc.MessageOption()
let data = rpc.MessageParcel.create()
let reply = rpc.MessageParcel.create()
// 往data里写入参数
proxy.sendRequest(1, data, reply, option)
.then(function(result) {
if (result.errCode != 0) {
console.error("send request failed, errCode: " + result.errCode)
return
}
// 从result.reply里读取结果
})
.catch(function(e) {
console.error("send request got exception: " + e)
}
.finally(() => {
data.reclaim()
reply.reclaim()
})
// 使用回调函数
function sendRequestCallback(result) {
try {
if (result.errCode != 0) {
console.error("send request failed, errCode: " + result.errCode)
return
}
// 从result.reply里读取结果
} finally {
result.data.reclaim()
result.reply.reclaim()
}
}
let option = new rpc.MessageOption()
let data = rpc.MessageParcel.create()
let reply = rpc.MessageParcel.create()
// 往data里写入参数
proxy.sendRequest(1, data, reply, option, sendRequestCallback)
本文主要记录常见的 Linux 命令,特别是那些经常遇到但是容易忘记的命令用法。