---
title: "java.lang.OutOfMemoryError: Java heap space错误及处理办法"
author: "liubingjun"
date: "2011-05-20T10:33:26Z"
tags: []
categories: ["编程语言"]
slug: "java-lang-outofmemoryerror-java-heap-space"
draft: false
lastmod: "2011-05-20T10:39:28Z"
id: 1051335
url: "https://liubingjun.iteye.com/blog/1051335"
---

java.lang.OutOfMemoryError: Java heap space  
\================================================  
\===

使用Java程序从数据库中查询大量的数据时出现异常:  
java.lang.OutOfMemoryError: Java heap space

修改myeclipse/eclipse的运行内存即可。操作步骤：![](http://dl.iteye.com/upload/picture/pic/90611/00a1f72e-8d81-3299-bc4f-cb4650904d65.jpg%20)——&gt;![](http://dl.iteye.com/upload/picture/pic/90613/cf216742-56fd-32d4-ae2e-d2126a631e84.jpg%20)