Coder Social home page Coder Social logo

Comments (8)

xtaci avatar xtaci commented on May 18, 2024

不单纯是NewSegment的问题,所有涉及动态内存分配的地方,包括字符串拼接(from.String())都有可能导致内存上涨,小内存真的不太适合带GC的语言。

整体感觉这个问题相当难解决,你可以试试加个定时器,强制runtime.GC(),STW。

from kcp-go.

xtaci avatar xtaci commented on May 18, 2024

另外,你可以参考下kcptun,release中有编译好的arm5,6,7,可以尝试在openwrt的路由器上运行观察,我手头没有这样的设备。

from kcp-go.

gyf19 avatar gyf19 commented on May 18, 2024

@xtaci 说得有道理. 我有一个pool版本 https://github.com/gyf19/kcp-go , @jannson 也可以测试一下。

from kcp-go.

gyf19 avatar gyf19 commented on May 18, 2024

@jannson r8000路由器什么时候出 梅林版本? 急

from kcp-go.

xtaci avatar xtaci commented on May 18, 2024

我试过用go-slab来做segment.data的分配

但是,我很难评估其有效性,或许更糟也说不定,我开个分支slab

from kcp-go.

bg5sbk avatar bg5sbk commented on May 18, 2024

@xtaci 可以试试这个 https://github.com/funny/slab

from kcp-go.

jannson avatar jannson commented on May 18, 2024

@xtaci 感谢。之前实现一个 p2p 的版本,目前用于远程别人的路由器。未来我重构这个项目的时候我来尝试下。谢谢。

@gyf19 R8000 梅林已经有人在开发了,并且 tomato 版本也有了,中文版本也快了。估计是时间问题而已了。具体咱们就不再这里讨论了,我瞧瞧你提供的项目!感谢。

from kcp-go.

jannson avatar jannson commented on May 18, 2024

runtime.GC 手动配置运行的话, 也不知道什么时候应该运行.还有就是一运行,整个程序级别的会被 block.(不知道会被 block 多久.)

看到另外一个函数,可以按需多次触发回收.
func SetGCPercent(percent int) int
比如我设置 SetGCPercent(50) 这样.应该让内存不会增长得太快吧

from kcp-go.

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.