当前位置:操作系统 > 安卓/Android >>

absoluteMaxSize dalvik.vm.heapsize

   没翅膀的飞鸟〝
d:\linux\linuxkernel\WORKING_DIRECTORY\android-omap-20111108-gingerbread\dalvik\vm\alloc\HeapSource.c
GcHeap *
dvmHeapSourceStartup(size_t startSize, size_t absoluteMaxSize)
{
    /*
     * Allocate a contiguous region of virtual memory to subdivided
     * among the heaps managed by the garbage collector.
     */
    length = ALIGN_UP_TO_PAGE_SIZE(absoluteMaxSize);
//    base = dvmAllocRegion(length, PROT_NONE, "dalvik-heap");
//doesn't support PROT_NONE on windows
    base = dvmAllocRegion(length, PROT_READ | PROT_WRITE, "dalvik-heap");
d:\linux\linuxkernel\WORKING_DIRECTORY\android-omap-20111108-gingerbread\dalvik\vm\alloc\Heap.c
bool dvmHeapStartup()
{
    gcHeap = dvmHeapSourceStartup(gDvm.heapSizeStart, gDvm.heapSizeMax);
d:\linux\linuxkernel\WORKING_DIRECTORY\android-omap-20111108-gingerbread\dalvik\vm\alloc\Alloc.c
bool dvmGcStartup(void)
{
    dvmInitMutex(&gDvm.gcHeapLock);
 
 
    return dvmHeapStartup();
}
d:\linux\linuxkernel\WORKING_DIRECTORY\android-omap-20111108-gingerbread\dalvik\vm\Init.c
static int dvmProcessOptions(int argc, const char* const argv[],
    bool ignoreUnrecognized)
{
        } else if (strncmp(argv[i], "-Xmx", 4) == 0) {
int dvmStartup(int argc, const char* const argv[], bool ignoreUnrecognized,
    JNIEnv* pEnv)
{
    setCommandLineDefaults();
    cc = dvmProcessOptions(argc, argv, ignoreUnrecognized);
if (!dvmGcStartup())
int dvmPrepForDexOpt(const char* bootClassPath, DexOptimizerMode dexOptMode,
    DexClassVerifyMode verifyMode, int dexoptFlags)
{
    setCommandLineDefaults();
if (!dvmGcStartup())
d:\linux\linuxkernel\WORKING_DIRECTORY\ango\angowx\android\AndroidRuntime\AndroidRuntime.cpp
int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv)
{
    strcpy(heapsizeOptsBuf, "-Xmx");
    property_get("dalvik.vm.heapsize", heapsizeOptsBuf+4, "16m");
    opt.optionString = heapsizeOptsBuf;
    mOptions.add(opt);www.zzzyk.com
    if (JNI_CreateJavaVM(pJavaVM, pEnv, &initArgs) < 0) {
D:\linux\linuxkernel\WORKING_DIRECTORY\android-omap-20111108-gingerbread\dalvik\vm\Jni.c
    if (dvmStartup(argc, argv, args->ignoreUnrecognized, (JNIEnv*)pEnv) != 0) {
 
 
d:\linux\linuxkernel\WORKING_DIRECTORY\android-omap-20111108-gingerbread\dalvik\vm\Init.c
static void setCommandLineDefaults()
{
    /* Defaults overridden by -Xms and -Xmx.
     * TODO: base these on a system or application-specific default
     */
    gDvm.heapSizeStart = 2 * 1024 * 1024;   // Spec says 16MB; too big for us.
//    gDvm.heapSizeMax = 16 * 1024 * 1024;    // Spec says 75% physical mem
    gDvm.heapSizeMax = 32 * 1024 * 1024;    // Spec says 75% physical mem
补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,