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

标签 android hprof

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

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

但是我看到了错误信息。

android error message

所以我尝试在 DDMS 中获取转储文件(示例文件名:android.hprof)。

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

hprof-conv android.hprof standard.hprof

然后 hprof-conv 返回消息 ERROR: read 40070 of 65559 bytes

有人帮我。

最佳答案

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;
}

关于android - 我无法在 Lollipop 上将 Android HPROF 转换为标准 HPROF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32409289/

相关文章:

java - Android:切换按钮(允许多次点击)

javascript - Android WebView : Can't go back to previous page

android - 通过 GCM 向 Android/IOS 推送静默通知

android - Android Studio 中的 GC 和 java 堆分析

Java Mission Control 显示 "few profiling samples",为什么,我的其他选项是什么?

Java 分析 : View binary hprof cpu sampling dumps

java - 从二进制堆转储中提取 JVM 正常运行时间

android - 自定义滑动动画(倾斜、卡片组、3D 等)

android - 如何使用 Twitter4j 在没有用户身份验证的情况下获得 Twitter 公共(public)时间线?

java - 类似HPjmeter的图形工具查看-agentlib :hprof profiling output