---
title: "android dex工具打包Could not reserve enough space for object heap的问题"
author: "loveofgod"
date: "2012-03-31T13:12:52Z"
tags: []
categories: ["移动开发"]
slug: "android-dex-could-not-reserve-enough-space-for-object-heap"
draft: false
lastmod: "2012-03-31T13:12:52Z"
id: 1471486
url: "https://akalius.iteye.com/blog/1471486"
---

ANTBUILD : [dx] error : Could not create the Java Virtual Machine. 
ANTBUILD : [dx] error : A fatal exception has occurred. Program will exit. 
[dx] Error occurred during initialization of VM 
[dx] Could not reserve enough space for object heap 
這問題，打開 android-sdks\platform-tools 目錄中的 dx.bat 檔案，將 
set defaultXmx=-Xmx1024M 
改為 
set defaultXmx=-Xmx512M