用Go STL查询DB引发的内存泄露

本文同时提供以下语言的翻译:English

问题起因

这几天有一个 Go API service 经过定时监控发现占用的内存不断上涨,内存从初始的 70M 一直上升到超过 1G 直到吃光内存退出,基本上就可以断定是存在内存泄露的问题了,但是因为自带垃圾回收的语言出现内存泄露的情况较少,如果存在那一定是大问题,因此有了下文详细的排查过程,为日后处理此类问题积累经验。

阅读更多

Memory Leak Caused by Using Go STL to Query DB

Problem Origin

Recently, a Go API service was found to have continuously increasing memory usage through regular monitoring. The memory usage rose from the initial 70MB to over 1GB until it ran out of memory and crashed. This clearly indicated a memory leak issue. Since memory leaks rarely occur in languages with built-in garbage collection, if there is one, it must be a significant problem. Therefore, the following detailed investigation process was carried out to accumulate experience for handling similar issues in the future.

阅读更多

一文讲透koa-源码剖析

前言

本文从头开始由浅入深剖析现在十分流行的koa框架的核心源码,适合已经熟练掌握koa框架使用的开发人员阅读

核心机制

现在,让我们从头开始看看koa的内部究竟做了些什么?

阅读更多