Git Product home page Git Product logo

Comments (4)

crackgame avatar crackgame commented on August 24, 2024

我这样改了,不确定是否正确

bool LogerManager::stop()
{
if (_runing)
{
showColorText("log4z stopping \r\n", LOG_LEVEL_FATAL);
_runing = false;
wait();

    while(!_freeLogDatas.empty()) {
        delete _freeLogDatas.back();
        _freeLogDatas.pop_back();
    }

    return true;
}
return false;

}

from log4z.

zsummer avatar zsummer commented on August 24, 2024

内存会被系统回收, 并且freelist中的用以重用的驻留内存块数不超过200个, 做这些事情是多余的.

from log4z.

acrobatman avatar acrobatman commented on August 24, 2024

你好,你这个可重用的驻留内存块使用前提是进程不退出的情况下吧,如果对于服务端多进程模式,每笔业务开启一个进程,业务完成进程退出(正常或者异常),这种情况下驻留内存能保证不增长吗?抱歉,我还没有看代码

from log4z.

zsummer avatar zsummer commented on August 24, 2024

这里驻留内存的意思是 在进程的生命周期内这些内存不会释放, 进程退出后 所有内存内存都会被系统回收掉.
只要不是共享内存这种跨进程生命周期的特殊内存分配, 在进程退出后 所有该进程分配的内存都会被操作系统回收掉, 这个是操作系统的基础知识. 详细的资料可以随便搜索下关键字 操作系统 内存管理就可以获取到.

from log4z.

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.