-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
491 lines (300 loc) · 20.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<html lang="en"></html>
<!-- Google Analytics -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-128207704-1', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
<title>不輟集</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="筆耕不輟,日有所知,月無忘其所能">
<meta property="og:type" content="website">
<meta property="og:title" content="不輟集">
<meta property="og:url" content="https://blog.tsunhualim.top/index.html">
<meta property="og:site_name" content="不輟集">
<meta property="og:description" content="筆耕不輟,日有所知,月無忘其所能">
<meta property="og:locale" content="zh_TW">
<meta property="article:author" content="Hua">
<meta property="article:tag" content="漢字,閩南語,福建話,潮州話,甲子話,編程語言,Java,Go">
<meta name="twitter:card" content="summary">
<link rel="shortcut icon" href="favicon.ico" />
<link href="//fonts.font.im/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/css/style.css">
<meta name="generator" content="Hexo 5.4.2"><link rel="alternate" href="/atom.xml" title="不輟集" type="application/atom+xml">
</head>
<body>
<div id="container">
<div id="wrap">
<header id="header">
<div id="banner"></div>
<div id="header-outer" class="outer">
<div id="header-title" class="inner">
<h1 id="logo-wrap">
<a href="/" id="logo">不輟集</a>
</h1>
<h2 id="subtitle-wrap">
<a href="/" id="subtitle">Keep Yourself Alive</a>
</h2>
</div>
<div id="header-inner" class="inner">
<nav id="main-nav">
<a id="main-nav-toggle" class="nav-icon"><span class="fa fa-bars"></span></a>
<a class="main-nav-link" href="/">頭頁</a>
<a class="main-nav-link" target="_blank" rel="noopener" href="https://hokkien-writing.github.io/">閩南語書寫</a>
<a class="main-nav-link" href="/atom.xml">RSS</a>
<a class="main-nav-link" target="_blank" rel="noopener" href="https://github.com/tsunhua">GitHub</a>
</nav>
<!-- <nav id="main-nav">
<a id="main-nav-toggle" class="nav-icon"></a>
<a class="main-nav-link" href="/">頭頁</a>
<a class="main-nav-link" target="_blank" rel="noopener" href="https://hokkien-writing.github.io/">閩南語書寫</a>
<a class="main-nav-link" href="/atom.xml">RSS</a>
<a class="main-nav-link" target="_blank" rel="noopener" href="https://github.com/tsunhua">GitHub</a>
</nav> -->
<nav id="sub-nav">
<a id="nav-search-btn" class="nav-icon" title="搜尋"></a>
</nav>
<div id="search-form-wrap">
<div class="search-form">
<input type="search" id="local-search-input" name="q" results="0" placeholder="搜尋"
class="search-form-input" />
</div>
</div>
</div>
<div id="local-search-result" class="local-search-result-cls"></div>
</div>
</header>
<div class="outer">
<section id="main">
<article id="post-essay/be-myself" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/essay/be-myself/" class="article-date">
<time datetime="2024-11-22T14:22:00.000Z" itemprop="datePublished">2024-11-22</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/essay/be-myself/">做一個「不成材」的人</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>我病了,基因突變了,準備給醫生割一刀了。</p>
<p>回首過去三十年來,在燈火闌珊處,雖偶有良師益友相伴,心中依然焦躁不安。一直以來被培養成材,成爲特定用途的器物,以求在社會中發揮功用,有工作有收入能生存。如今,這器物也有壞的時候了。</p>
<p class="article-more-link">
<a href="/essay/be-myself/#more">接續讀落</a>
</p>
</div>
<footer class="article-footer">
<a data-url="https://blog.tsunhualim.top/essay/be-myself/" data-id="cm3tinjh80002fhjng6is4rr2" class="article-share-link">分享</a>
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%80%9D%E8%80%83/" rel="tag">思考</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%9A%A8%E7%AD%86/" rel="tag">隨筆</a></li></ul>
</footer>
</div>
</article>
<article id="post-it/python/python-memory" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/it/python/python-memory/" class="article-date">
<time datetime="2024-08-03T14:38:00.000Z" itemprop="datePublished">2024-08-03</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/it/python/python-memory/">Python 程序內存管理及OOM問題分析</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="內存管理"><a href="#內存管理" class="headerlink" title="內存管理"></a>內存管理</h2><p>Python 採用以引用計數法為主,以標記-清除算法和分代收集為輔的內存管理策略。</p>
<p>標記-清除算法會從根節點出發標記所有「活動對象」,然後再將沒有標記到的對象標記為「非活動對象」進行回收。因此該算法可以用來解決循環引用導致的內存洩漏問題。</p>
<p>分代收集算法會將內存對象分到三個世代中,每個代觸發回收時只回收當前代,並將存活的對象轉移到下一代,對象所在世代越久遠的越不可能是垃圾,觸發回收的頻率越低。因此該算法通過空間換時間的方式提高了垃圾回收效率。</p>
<h2 id="OOM-問題分析"><a href="#OOM-問題分析" class="headerlink" title="OOM 問題分析"></a>OOM 問題分析</h2><p>當進程中有大量線程在等待執行,或者有大對象未被及時釋放時,會造成系統內存資源緊張,甚至 OOM(內存溢出),從而服務進程被 kill。</p>
<p class="article-more-link">
<a href="/it/python/python-memory/#more">接續讀落</a>
</p>
</div>
<footer class="article-footer">
<a data-url="https://blog.tsunhualim.top/it/python/python-memory/" data-id="cm3tiexr40049emjnhzr614kq" class="article-share-link">分享</a>
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Python/" rel="tag">Python</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E4%BB%A3%E7%A2%BC%E5%AE%B6/" rel="tag">代碼家</a></li></ul>
</footer>
</div>
</article>
<article id="post-it/python/python-efficient" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/it/python/python-efficient/" class="article-date">
<time datetime="2024-07-28T02:49:00.000Z" itemprop="datePublished">2024-07-28</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/it/python/python-efficient/">Python 程序如何做到高效且穩健?</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>Python 幾乎是每個程序員都會使用的語言,但大多數人都將 Python 視為腳本語言,在需要的時候運行一下,進行數據處理或抓取等。大部分情況下都是一次性的工作(Job),很少有人會將其作爲長期運行的後端服務。這是爲何?</p>
<p>Python 是一門解釋型的語言,其依賴於 Python解釋器(或直譯器,官方的且最流行的是 CPython解釋器)來加載源代碼然後解釋運行。解釋運行使得 Python可以在終端中直接運行 <code>python</code> 即可開始一邊寫代碼一邊看運行結果,對用戶相當友好,但與之同時也帶來了無可避免的性能問題,從而難以成為後端服務的主流。主流如 Java、Go 都是編譯型的語言,意味著源代碼需要先編譯成二進制文件(在Java中是字節碼),然後直接在運行時(在Java中是JVM)中運行,且在編譯成二進制文件的過程中通常會進行若干優化,使得運行的程序更加高效。</p>
<p class="article-more-link">
<a href="/it/python/python-efficient/#more">接續讀落</a>
</p>
</div>
<footer class="article-footer">
<a data-url="https://blog.tsunhualim.top/it/python/python-efficient/" data-id="cm3tiexr30048emjnahmsfqce" class="article-share-link">分享</a>
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Python/" rel="tag">Python</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E4%BB%A3%E7%A2%BC%E5%AE%B6/" rel="tag">代碼家</a></li></ul>
</footer>
</div>
</article>
<article id="post-essay/first-day-in-2023" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/essay/first-day-in-2023/" class="article-date">
<time datetime="2023-01-01T15:36:42.000Z" itemprop="datePublished">2023-01-01</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/essay/first-day-in-2023/">2023年頭一日</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>透早起身,靜坐四个字久,然後體目睇世界。</p>
<p>這個熟悉又陌生个世界。</p>
<p>行去外口食个腸粉,路上幾個阿叔阿嬸行來行去,有儂正去上街,有儂上街正轉來。</p>
<p class="article-more-link">
<a href="/essay/first-day-in-2023/#more">接續讀落</a>
</p>
</div>
<footer class="article-footer">
<a data-url="https://blog.tsunhualim.top/essay/first-day-in-2023/" data-id="cm3tiexp90004emjnek9o9oim" class="article-share-link">分享</a>
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%96%A9%E8%AA%9E%E6%96%87/" rel="tag">閩語文</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%9A%A8%E7%AD%86/" rel="tag">隨筆</a></li></ul>
</footer>
</div>
</article>
<article id="post-essay/covid19-and-me" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/essay/covid19-and-me/" class="article-date">
<time datetime="2022-12-24T14:56:42.000Z" itemprop="datePublished">2022-12-24</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/essay/covid19-and-me/">穢着新冠之後</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>最近全國攏在佮新冠病毒共存,我也<strong>穢着</strong>(ùe–tio̍h, 感染)了,時間是2022年12月20日。</p>
<p>到今已經第六日了,情況好㩼囉。</p>
<p>好在我早有預備 <strong>加減</strong>(ke-kiám, 一點)藥、礦泉水、肉佮菜,生病期間免<strong>煩惱</strong>(huân-ló, 擔心)東煩惱西。</p>
<p class="article-more-link">
<a href="/essay/covid19-and-me/#more">接續讀落</a>
</p>
</div>
<footer class="article-footer">
<a data-url="https://blog.tsunhualim.top/essay/covid19-and-me/" data-id="cm3tiexp20001emjn3xat9ycr" class="article-share-link">分享</a>
<ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E6%96%B0%E5%86%A0/" rel="tag">新冠</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%96%A9%E8%AA%9E%E6%96%87/" rel="tag">閩語文</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E9%9A%A8%E7%AD%86/" rel="tag">隨筆</a></li></ul>
</footer>
</div>
</article>
<nav id="page-nav">
<span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="page-number" href="/page/3/">3</a><span class="space">…</span><a class="page-number" href="/page/8/">8</a><a class="extend next" rel="next" href="/page/2/">下一頁 »</a>
</nav>
</section>
<aside id="sidebar">
<div class="widget-wrap">
<h3 class="widget-title">貼示</h3>
<div class="widget" style="min-height: 50px;">
<img src="" height="50px" style="float: left; margin-right: 10px" />
<div style="font-size:medium; color:palevioletred;padding-top: 4px;">
<ul>
<li>
*
精力善用
</li>
<li>
*
筆耕不輟,日有所知,月無忘其所能
</li>
</ul>
</div>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">最新文章</h3>
<div class="widget">
<ul>
<li>
<a href="/essay/be-myself/">做一個「不成材」的人</a>
</li>
<li>
<a href="/it/python/python-memory/">Python 程序內存管理及OOM問題分析</a>
</li>
<li>
<a href="/it/python/python-efficient/">Python 程序如何做到高效且穩健?</a>
</li>
<li>
<a href="/essay/first-day-in-2023/">2023年頭一日</a>
</li>
<li>
<a href="/essay/covid19-and-me/">穢着新冠之後</a>
</li>
</ul>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">專輯</h3>
<div class="widget tagcloud">
<!-- <a href="/tags/Go/" style="font-size: 17.14px;">Go</a> <a href="/tags/Hello/" style="font-size: 10px;">Hello</a> <a href="/tags/Java/" style="font-size: 12.86px;">Java</a> <a href="/tags/Python/" style="font-size: 11.43px;">Python</a> <a href="/tags/TODO/" style="font-size: 11.43px;">TODO</a> <a href="/tags/Unicode/" style="font-size: 10px;">Unicode</a> <a href="/tags/net/" style="font-size: 10px;">net</a> <a href="/tags/pprof/" style="font-size: 10px;">pprof</a> <a href="/tags/protobuf/" style="font-size: 10px;">protobuf</a> <a href="/tags/%E4%BB%A3%E7%A2%BC%E5%AE%B6/" style="font-size: 20px;">代碼家</a> <a href="/tags/%E5%8D%81%E4%BA%8C%E7%94%9F%E8%82%96/" style="font-size: 10px;">十二生肖</a> <a href="/tags/%E5%93%B2%E5%AD%B8/" style="font-size: 11.43px;">哲學</a> <a href="/tags/%E5%B9%B2%E6%94%AF%E7%B4%80%E5%B9%B4%E6%B3%95/" style="font-size: 10px;">干支紀年法</a> <a href="/tags/%E6%80%9D%E8%80%83/" style="font-size: 10px;">思考</a> <a href="/tags/%E6%88%91%E6%80%9D/" style="font-size: 10px;">我思</a> <a href="/tags/%E6%96%B0%E5%86%A0/" style="font-size: 10px;">新冠</a> <a href="/tags/%E6%96%B0%E6%99%82%E4%BB%A3/" style="font-size: 10px;">新時代</a> <a href="/tags/%E6%97%A5%E6%9C%AC%E8%AA%9E/" style="font-size: 10px;">日本語</a> <a href="/tags/%E6%BD%AE%E5%8A%87/" style="font-size: 10px;">潮劇</a> <a href="/tags/%E6%BD%AE%E5%B7%9E%E8%A9%B1/" style="font-size: 11.43px;">潮州話</a> <a href="/tags/%E7%94%B2%E5%AD%90%E8%A9%B1/" style="font-size: 12.86px;">甲子話</a> <a href="/tags/%E8%81%86%E8%81%BD%E9%9F%B3%E6%A8%82/" style="font-size: 10px;">聆聽音樂</a> <a href="/tags/%E8%A8%AD%E8%A8%88%E6%A8%A1%E5%BC%8F/" style="font-size: 10px;">設計模式</a> <a href="/tags/%E8%A9%A9%E7%B6%93/" style="font-size: 10px;">詩經</a> <a href="/tags/%E8%BB%9F%E4%BB%B6%E6%9E%B6%E6%A7%8B/" style="font-size: 10px;">軟件架構</a> <a href="/tags/%E9%81%8A%E8%A8%98/" style="font-size: 11.43px;">遊記</a> <a href="/tags/%E9%96%A9%E5%8D%97%E8%AA%9E/" style="font-size: 14.29px;">閩南語</a> <a href="/tags/%E9%96%A9%E8%AA%9E%E6%96%87/" style="font-size: 15.71px;">閩語文</a> <a href="/tags/%E9%9A%A8%E7%AD%86/" style="font-size: 18.57px;">隨筆</a> <a href="/tags/%E9%9B%BB%E5%BD%B1/" style="font-size: 10px;">電影</a> <a href="/tags/%E9%AD%8F%E6%99%89%E9%A2%A8%E6%B5%81/" style="font-size: 11.43px;">魏晉風流</a> -->
<ul class="classtest-list" itemprop="keywords"><li class="classtest-list-item"><a class="classtest-list-link" href="/tags/%E4%BB%A3%E7%A2%BC%E5%AE%B6/" rel="tag">代碼家</a><span class="classtest-list-count">15</span></li><li class="classtest-list-item"><a class="classtest-list-link" href="/tags/%E9%9A%A8%E7%AD%86/" rel="tag">隨筆</a><span class="classtest-list-count">11</span></li><li class="classtest-list-item"><a class="classtest-list-link" href="/tags/Go/" rel="tag">Go</a><span class="classtest-list-count">8</span></li><li class="classtest-list-item"><a class="classtest-list-link" href="/tags/%E9%96%A9%E8%AA%9E%E6%96%87/" rel="tag">閩語文</a><span class="classtest-list-count">6</span></li><li class="classtest-list-item"><a class="classtest-list-link" href="/tags/%E9%96%A9%E5%8D%97%E8%AA%9E/" rel="tag">閩南語</a><span class="classtest-list-count">5</span></li></ul>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">二維碼</h3>
<div class="widget">
<img src="https://tsunhua.github.io/qrcode.jpg" width="100%" style="max-width: 200px;" />
</div>
</div>
</aside>
</div>
<footer id="footer">
<div class="outer">
<div id="footer-info" class="inner">
<a rel="license noopener" target="_blank" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="創用 CC 授權條款"
style="border-width:0" src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a>
<br />
Edited by
<a xmlns:cc="http: //creativecommons.org/ns#" target="_blank" href="https://github.com/tsunhua" property="cc:attributionName"
rel="cc:attributionURL noopener">Hua
</a>
<br>
Powered by
<a href="https://github.com/" target="_blank">Github</a> &
<a href="https://hexo.io/" target="_blank">Hexo</a>
<br />
</div>
</div>
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
</footer>
</div>
<nav id="mobile-nav">
<a class="mobile-nav-link mobile-nav-main" href="/">頭頁</a>
<a class="mobile-nav-link mobile-nav-main" target="_blank" rel="noopener" href="https://hokkien-writing.github.io/">閩南語書寫</a>
<a class="mobile-nav-link mobile-nav-main" href="/atom.xml">RSS</a>
<a class="mobile-nav-link mobile-nav-main" target="_blank" rel="noopener" href="https://github.com/tsunhua">GitHub</a>
</nav>
<script src="//cdn.bootcss.com/jquery/2.0.3/jquery.min.js"></script>
<script src="/js/search.js"></script>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script src="/js/script.js"></script>
</div>
</body>
</html>