Giter Site home page Giter Site logo

疑似内存泄漏 about panindex HOT 8 CLOSED

px-org avatar px-org commented on August 15, 2024
疑似内存泄漏

from panindex.

Comments (8)

libsgh avatar libsgh commented on August 15, 2024

天翼云获取下载地址的时候,有些文件获取不到,你是不是有些文件可以下载 有些不能下载

from panindex.

kasuganosoras avatar kasuganosoras commented on August 15, 2024

好像没遇到,我是作为软件分发下载用的,一般都是固定几个文件。

几分钟前又报了一个错,但是被 screen 截断了,只看到下面这些错误内容:

net/http.(*conn).serve.func1(0xc000221680)
        /usr/local/go/src/net/http/server.go:1824 +0x153
panic(0xc2a900, 0x13c9330)
        /usr/local/go/src/runtime/panic.go:971 +0x499
PanIndex/Util.GetDownlaodUrl(0xc00048a0f0, 0x24, 0xc0005c8cb0, 0x68, 0x10, 0xbfa5a0)
        /github/workspace/Util/Cloud189.go:137 +0x27d
PanIndex/service.GetDownlaodUrl(0xc00048a0f0, 0x24, 0xc000400ac8, 0x15, 0xc0002267c8, 0x8, 0xc000226830, 0xb, 0xc0002268a0, 0xe, ...)
        /github/workspace/service/service.go:181 +0x285
main.index(0xc0003fa1e0)
        /github/workspace/main.go:224 +0x958
main.main.func1(0xc0003fa1e0)
        /github/workspace/main.go:134 +0x8ec
github.com/gin-gonic/gin.(*Context).Next(...)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161
github.com/gin-gonic/gin.LoggerWithConfig.func1(0xc0003fa1e0)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 +0xf4
github.com/gin-gonic/gin.(*Context).Next(...)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161
github.com/gin-gonic/gin.serveError(0xc0003fa1e0, 0x194, 0x14014b0, 0x12, 0x12)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 +0x49
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc0000ee000, 0xc0003fa1e0)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:438 +0x4fc
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc0000ee000, 0xe12a28, 0xc000a94380, 0xc000498200)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:367 +0x14d
net/http.serverHandler.ServeHTTP(0xc0004fe000, 0xe12a28, 0xc000a94380, 0xc000498200)
        /usr/local/go/src/net/http/server.go:2887 +0xa3
net/http.(*conn).serve(0xc000221680, 0xe14a20, 0xc00061aac0)
        /usr/local/go/src/net/http/server.go:1952 +0x8cd
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:3013 +0x39b

from panindex.

kasuganosoras avatar kasuganosoras commented on August 15, 2024

由于请求量很大,所以我在 htop 里面看到 PanIndex 的内存占用率是肉眼可见的速度在增长……基本上挂一个小时左右就能把 32G 内存吃满,现在只能先临时降级回旧版本使用了……

from panindex.

libsgh avatar libsgh commented on August 15, 2024

由于请求量很大,所以我在 htop 里面看到 PanIndex 的内存占用率是肉眼可见的速度在增长……基本上挂一个小时左右就能把 32G 内存吃满,现在只能先临时降级回旧版本使用了……

和版本没关系,这里就没改过,看日志是获取下载地址的时候产生了异常,我发现获取下载地址的接口 如果有并发会导致这个异常,不知道官方是不是做了限制或者是维护升级,我在官网看到了这个
image

预览图片的时候 会加载7张图片,连续获取7次下载地址,有几次会无法获取,单击某个文件都是可以下载的
image

这里我可以改下,做一下异常处理 不会导致内存溢出,但是下载地址获取失败的问题 还要再看看是不是官方的接口不稳定或是加了某种限制

from panindex.

libsgh avatar libsgh commented on August 15, 2024

试试2.0.1版本

from panindex.

kasuganosoras avatar kasuganosoras commented on August 15, 2024

在最新版本 v2.0.3 中再次出现内存泄漏问题,挂着 2 小时左右就占用了 6GB 内存,并且持续增长
最后截取到报错内容(前面的被 screen 截掉了,没看到):

        /github/workspace/main.go:270 +0xa72
main.main.func1(0xc00057a000)
        /github/workspace/main.go:148 +0x965
github.com/gin-gonic/gin.(*Context).Next(...)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161
github.com/gin-gonic/gin.LoggerWithConfig.func1(0xc00057a000)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 +0xf4
github.com/gin-gonic/gin.(*Context).Next(...)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:161
github.com/gin-gonic/gin.serveError(0xc00057a000, 0x194, 0x1437570, 0x12, 0x12)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 +0x49
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest(0xc000448280, 0xc00057a000)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:438 +0x4fc
github.com/gin-gonic/gin.(*Engine).ServeHTTP(0xc000448280, 0xe3c928, 0xc0009517a0, 0xc0007a3000)
        /go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:367 +0x14d
net/http.serverHandler.ServeHTTP(0xc000152000, 0xe3c928, 0xc0009517a0, 0xc0007a3000)
        /usr/local/go/src/net/http/server.go:2887 +0xa3
net/http.(*conn).serve(0xc00061c8c0, 0xe3ea60, 0xc0003f3a00)
        /usr/local/go/src/net/http/server.go:1952 +0x8cd
created by net/http.(*Server).Serve
        /usr/local/go/src/net/http/server.go:3013 +0x39b

from panindex.

libsgh avatar libsgh commented on August 15, 2024

还是天翼云是么

from panindex.

kasuganosoras avatar kasuganosoras commented on August 15, 2024

是的,大约每分钟有 100 个请求左右就会不断开始出现报错,然后内存占用率越来越高。
上古版本(就是我当时新增打码狗功能的那个版本)没有出现这个问题。

from panindex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.