Android教程網
  1. 首頁
  2. Android 技術
  3. Android 手機
  4. Android 系統教程
  5. Android 游戲
 Android教程網 >> Android技術 >> 關於Android編程 >> absoluteMaxSize dalvik.vm.heapsize

absoluteMaxSize dalvik.vm.heapsize

編輯:關於Android編程

   沒翅膀的飛鳥〝 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.2cto.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
  1. 上一頁:
  2. 下一頁:
熱門文章
閱讀排行版
Copyright © Android教程網 All Rights Reserved