单应用可用的最大内存
dalvik.vm.heapstartsize,它表示堆分配的初始大小。 APP启动的初始分配内存
dalvik.vm.heapgrowthlimit,它表示单个进程内存限定值。App最大内存限制
dalvik.vm.heapsize,单个进程可用的最大内存。开启largeHeap="true"的最大限制
指令:获取某项dalvik属性。
adb shell getprop dalvik.vm.heapsize
PS C:\Users\liyd\StudioProjects\jjgamesdk\Architecture_V2\Modules\outjars> adb shell getprop dalvik.vm.heapsize
512m
指令:获取所有dalvik属性数据。
PS C:\Users\liyd\StudioProjects\jjgamesdk\Architecture_V2\Modules\outjars> adb shell getprop
[DEVICE_PROVISIONED]: [1]
[aaudio.hw_burst_min_usec]: [2000]
[aaudio.mmap_exclusive_policy]: [2]
[aaudio.mmap_policy]: [2]
[adjust.preinstall.path]: [/data/etc/appchannel/adjust.preinstall]
[af.fast_track_multiplier]: [1]
[apex.all.ready]: [true]
[arm64.memtag.process.system_server]: [off]
[audio.deep_buffer.media]: [true]
[audio.offload.min.duration.secs]: [30]
[audio.offload.video]: [true]
[audio.sys.mute.latency.factor]: [2]
[audio.sys.noisy.broadcast.delay]: [500]
[audio.sys.offload.pstimeout.secs]: [3]
[audio.sys.routing.latency]: [0]
[bluetooth.profile.a2dp.source.enabled]: [true]
[bluetooth.profile.asha.central.enabled]: [true]
[bluetooth.profile.avrcp.controller.enabled]: [false]
[bluetooth.profile.avrcp.target.enabled]: [true]
[bluetooth.profile.gatt.enabled]: [true]
[bluetooth.profile.hfp.ag.enabled]: [true]
[bluetooth.profile.hid.device.enabled]: [true]
[bluetooth.profile.hid.host.enabled]: [true]
[bluetooth.profile.map.server.enabled]: [true]
[bluetooth.profile.opp.enabled]: [true]
[bluetooth.profile.pan.nap.enabled]: [true]
[bluetooth.profile.pan.panu.enabled]: [true]
[bluetooth.profile.pbap.server.enabled]: [true]
[bluetooth.profile.sap.server.enabled]: [false]
[bootreceiver.enable]: [0]
[build.version.extensions.ad_services]: [7]
[build.version.extensions.r]: [7]
[build.version.extensions.s]: [7]
[build.version.extensions.t]: [7]
[build.version.extensions.u]: [7]
[cache_key.bluetooth.bluetooth_adapter_get_connection_state]: [6721676659151905297]
[cache_key.bluetooth.bluetooth_adapter_get_profile_connection_state]: [6721676659151905298]
[cache_key.bluetooth.bluetooth_adapter_get_state]: [6721676659151905299]
[cache_key.bluetooth.bluetooth_adapter_is_offloaded_filtering_supported]: [6721676659151905292]
[cache_key.bluetooth.bluetooth_device_get_bond_state]: [6721676659151905293]
[cache_key.bluetooth.bluetooth_map_get_connection_state]: [6721676659151905296]
[cache_key.bluetooth.bluetooth_sap_get_connection_state]: [6721676659151905290]
[cache_key.display_info]: [-5491857702697502677]
[cache_key.get_packages_for_uid]: [-5491857702697502756]
[cache_key.has_system_feature]: [-5491857702697503917]
[cache_key.is_compat_change_enabled]: [-5491857702697502675]
[cache_key.is_interactive]: [-5491857702697502755]
[cache_key.is_power_save_mode]: [-5491857702697503287]
[cache_key.is_user_unlocked]: [-5491857702697503627]
[cache_key.location_enabled]: [-5491857702697503901]
[cache_key.package_info]: [-5491857702697502674]
[cache_key.system_server.accounts_data]: [-5491857702697503248]
[cache_key.system_server.device_policy_manager_caches]: [-5491857702697503902]
[cache_key.system_server.get_credential_type]: [-5491857702697503885]
[cache_key.telephony.phone_account_to_subid]: [-4701367044188560224]
[cache_key.telephony.subscription_manager_service]: [-4701367044188560227]
[config.disable_rtt]: [true]
[dalvik.vm.appimageformat]: [lz4]
[dalvik.vm.background-dex2oat-threads]: [4]
[dalvik.vm.dex2oat-Xms]: [64m]
[dalvik.vm.dex2oat-Xmx]: [512m]
[dalvik.vm.dex2oat-max-image-block-size]: [524288]
[dalvik.vm.dex2oat-minidebuginfo]: [true]
[dalvik.vm.dex2oat-resolve-startup-strings]: [true]
[dalvik.vm.dex2oat64.enabled]: [true]
[dalvik.vm.dexopt.secondary]: [true]
[dalvik.vm.dexopt.thermal-cutoff]: [2]
[dalvik.vm.heapgrowthlimit]: [384m]
[dalvik.vm.heapmaxfree]: [8m]
[dalvik.vm.heapminfree]: [512k]
[dalvik.vm.heapsize]: [512m]
[dalvik.vm.heapstartsize]: [16m]
[dalvik.vm.heaptargetutilization]: [0.75]
导致OOM的常见原因
加载大图片
内存泄漏
捕捉OOM
异常体系
JPDA
Java 平台调试体系JPDA(Java PlatformDebugger Architecture),它是 Java 虚拟机为调试和监控虚拟机专门提供的一套接口。
JVMTI 是 IM 对外暴露的接口,JDI 是实现了 JDWP 通信协议的客户端,调试器通过它和 JVM 中被调试程序通信。