I ran across a little tip tonight I thought I should share. Trying to perform a large XSLT tranform with Ant kept giving me the following error: Out of memory. Increase Heap Size.
This is a Java error indicating that the virtual machine is out of memory. So now I know what the problem is, what next? If I was launching from a command line changing the heap size is not that tough. Just look up the options for java and set a new value, but I’m using Ant. Looking at the Ant shell script or batch file was no help.
Well a bit of Googling turned up that Ant looks for an environment variable called ANT_OPTS which is use to set Java parameters. Just set the environment variable and off you go. So I added the following to increase the heap size:
export ANT_OPTS=-Xmx256m
That sets the maximum heap size to 256 Megabytes. It solved my problem as the XSLT transform topped out at about 220Meg. So if you ever need to increase the size of the Ant JVM, now you know how.
分享到:
相关推荐
在使用Eclipse集成开发环境(IDE)进行ANT编译时,有时会遇到“OutOfMemory”错误,这通常意味着ANT在尝试编译大量代码或者运行复杂构建任务时,分配给它的内存不足。为了解决这个问题,我们需要调整ANT的内存设置,...
- 使用工具如VisualVM或MAT (Memory Analyzer Tool)来检测和定位潜在的内存泄漏点。 - 定期清理无用的临时文件和缓存数据。 4. **合理设置线程池大小**: - 在使用线程池时,合理设置最大线程数,避免因线程...
Thanks go out to SER[G]ANT for updating the russion translation files already June 23 2018:Cheat Engine 6.8.1 Released: Apparently 6.8 contained a couple of annoying bugs, so here's an update that ...
此外,如果工程较大,在构建过程中可能会因为Java内存不足导致“java out of memory”错误。针对这个问题,可以在用户目录下的.gradle文件夹中创建一个gradle.properties文件,并填入相应的配置参数,比如指定JVM的...
Compiler for Java, both of which are not supported for Android development----------------------------------- Android 编程基础 9 什么是 Android? Android? Android? Android? Android 是一个专门针对移动...