###### tags: `Linux`, `SRE` # SRE 讀書會 Round 4 #05 - 線上讀書會共筆 ## 活動資訊 * Date: [%DATETIME%] (四) 20:00 - 21:30 * [導讀進度表](https://docs.google.com/spreadsheets/d/1Lgti3mILkvwxyzklX1vvLraaGD-7ePK9rkmlulfOknE/edit#gid=0) * [導讀 Guideline](https://study-area.sre.tw/GuideLine/) * Github: [study-area-docs](https://github.com/cross-community/study-area-docs) --- # 現場共筆 - 14 | 答疑(二):如何用perf工具分析Java程序? 講者:義格 - [java in flame](https://netflixtechblog.com/java-in-flames-e763b3d32166):把 java stack 畫成火焰圖 - 15 | 基礎篇:Linux內存是怎麼工作的? 講者:小明 - 記憶體吃太兇,會被作業系統kill掉(綜合佔記憶體程度、佔CPU程度,計算分數,達標的被kill) - 快取與實際資料儲存位置分開 - 程式盡早釋放資源https://hackmd.io/bVCoapVUTTC7WeQF0ykTSw# - 16 | 基礎篇:怎麼理解內存中的Buffer和Cache? 講者:阿福 - 直接對 file system dd 一個檔案, 對 cache 影響比較大 - 直接對 /dev/sdX 進行 dd 指令, 對 buffer 影響比較大 - drop_caches - echo 1 > /proc/sys/vm/drop_caches, 清除 pagecache - echo 2 > /proc/sys/vm/drop_caches, 清除 dentries 與 inode - echo 3 > /proc/sys/vm/drop_caches, 1+2 一起清 --- # 參考資料 鹽酥雞![](https://i.imgur.com/22c6Qv3.jpg) ![](https://i.imgur.com/XH5qy7r.png) 有貓就給讚 ![](https://i.imgur.com/0ClgvDN.png) * [How does the OOM killer decide which process to kill first?](https://unix.stackexchange.com/questions/153585/how-does-the-oom-killer-decide-which-process-to-kill-first):The OOM Killer has to select the best process(es) to kill. Best here refers to that process which will free up the maximum memory upon killing and is also the least important to the system.