Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/208.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android GC_在何时何地并发调用?_Android_Garbage Collection_Dalvik - Fatal编程技术网

Android GC_在何时何地并发调用?

Android GC_在何时何地并发调用?,android,garbage-collection,dalvik,Android,Garbage Collection,Dalvik,我找到了dalvikvm的源代码,但找不到并发GC调用的位置 我从androidgit存储库中获得的malloc代码 static void gcForMalloc(bool clearSoftReferences) { if (gDvm.allocProf.enabled) { Thread* self = dvmThreadSelf(); gDvm.allocProf.gcCount++; if (self != NULL) {

我找到了dalvikvm的源代码,但找不到并发GC调用的位置

我从androidgit存储库中获得的malloc代码

static void gcForMalloc(bool clearSoftReferences)
{
    if (gDvm.allocProf.enabled) {
        Thread* self = dvmThreadSelf();
        gDvm.allocProf.gcCount++;
        if (self != NULL) {
            self->allocProf.gcCount++;
        }
    }
    /* This may adjust the soft limit as a side-effect.
     */
    const GcSpec *spec = clearSoftReferences ? GC_BEFORE_OOM : GC_FOR_MALLOC;
    dvmCollectGarbageInternal(spec);
}
我认为dvmCollectGarbageInternal函数优先于GC日志,但是GC\u并发没有任何内容

dvmCollectGarbageInternal函数的日志代码

if (!spec->isConcurrent) {
    u4 markSweepTime = dirtyEnd - rootStart;
    u4 gcTime = gcEnd - rootStart;
    bool isSmall = numBytesFreed > 0 && numBytesFreed < 1024;
    ALOGD("%s freed %s%zdK, %d%% free %zdK/%zdK, paused %ums, total %ums",
         spec->reason,
         isSmall ? "<" : "",
         numBytesFreed ? MAX(numBytesFreed / 1024, 1) : 0,
         percentFree,
         currAllocated / 1024, currFootprint / 1024,
         markSweepTime, gcTime);
} else {
    u4 rootTime = rootEnd - rootStart;
    u4 dirtyTime = dirtyEnd - dirtyStart;
    u4 gcTime = gcEnd - rootStart;
    bool isSmall = numBytesFreed > 0 && numBytesFreed < 1024;
    ALOGD("%s freed %s%zdK, %d%% free %zdK/%zdK, paused %ums+%ums, total %ums",
         spec->reason,
         isSmall ? "<" : "",
         numBytesFreed ? MAX(numBytesFreed / 1024, 1) : 0,
         percentFree,
         currAllocated / 1024, currFootprint / 1024,
         rootTime, dirtyTime, gcTime);
}
如果(!spec->isConcurrent){
u4 markSweepTime=dirtyEnd-rootStart;
u4 gcTime=gcEnd-rootStart;
bool isSmall=numBytesFreed>0&&numBytesFreed<1024;
ALOGD(“%s释放%s%zdK,%d%%释放%zdK/%zdK,暂停%ums,总计%ums”,
规格->原因,

isSmall?在中被调用。

检查此项。这是难题的第一部分。
gcDaemonThread()
在发出信号时唤醒。。。