我无法在Lollipop上将Android HPROF转换为标准HPROF

3

我的测试设备版本是5.0.1(棒棒糖)。

我在Android Studio 1.3中获取了Android堆转储文件。

但是我看到了错误信息。

android错误信息

因此,我尝试在DDMS中获取转储文件(例如文件名:android.hprof)。

然后我尝试将Android HPROF转换为标准HPROF文件。

hprof-conv android.hprof standard.hprof

然后,hprof-conv 返回错误信息:ERROR: read 40070 of 65559 bytes

请求帮助。


你找到了这个问题的原因吗? - Adil Aliyev
出现相同的错误:头转储内容似乎有问题。如果我重新启动平板电脑并在应用程序中的其他位置进行头转储,则可以正常工作。如果我执行我怀疑会泄漏的操作...它就会失败。 - JM Lord
当没有空间可用时,我遇到了这个错误。 - Dot Cink
1个回答

0

https://android.googlesource.com/platform/dalvik.git/+/android-4.2.2_r1/tools/hprof-conv/HprofConv.c#221

/*
 * Read some data, adding it to the expanding buffer.
 *
 * This will ensure that the buffer has enough space to hold the new data
 * (plus the previous contents).
 */
static int ebReadData(ExpandBuf* pBuf, FILE* in, size_t count, int eofExpected)
{
    size_t actual;
    assert(count > 0);
    ebEnsureCapacity(pBuf, count);
    actual = fread(pBuf->storage + pBuf->curLen, 1, count, in);
    if (actual != count) {
        if (eofExpected && feof(in) && !ferror(in)) {
            /* return without reporting an error */
        } else {
            fprintf(stderr, "ERROR: read %d of %d bytes\n", actual, count);
            return -1;
        }
    }
    pBuf->curLen += count;
    assert(pBuf->curLen <= pBuf->maxLen);
    return 0;
}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接