Couldn't reserve space for cygwin's heap"解决

原文地址::http://blog.csdn.net/tony2005/article/details/6213802


相关文章

1、

Couldn't reserve space for cygwin's heap, 错误解决

 ----http://blog.sina.com.cn/s/blog_55870a7f0100kz44.html

2、Couldn't reserve space for cygwin's heap, Win32 error 487----http://blog.csdn.net/hnmsky/article/details/4836016

3、Rebase.exe 的使用----http://blog.csdn.net/chenwanming507507507/article/details/6070882

4、Couldn't reserve space for cygwin's heap, Win32 error 0----http://blog.csdn.net/ba_jie/article/details/43056089

5、Git Extensions: Win32 error 487: Couldn't reserve space for cygwin's heap, Win32 error 0----http://stackoverflow.com/questions/18502999/git-extensions-win32-error-487-couldnt-reserve-space-for-cygwins-heap-win32


在安装了WinAVR以后,本来工作好好的,可是我为了安装调试程序,就把WinAVR卸载了,谁知道重新安装以后打开PN,怎么样也make不了,输出的出错信息如下:
 
> "make.exe" clean 
AllocationBase 0x0, BaseAddress 0x71590000, RegionSize 0x160000, State 0x10000 
C:/WinAVR/utils/bin/sh.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 487 

-------- begin -------- 

Cleaning project: 
rm -f main.hex 
AllocationBase 0x0, BaseAddress 0x71590000, RegionSize 0x160000, State 0x10000 
C:/WinAVR/utils/bin/rm.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 487 
make.exe: *** [clean_list] Error 1 

> Process Exit Code: 2
 
刚开始我以为是版本的问题,因为我第一次安装的时候遇到过这个问题,当时把程序删除掉重新安装了一下就解决了,所以我就按照这个思路多次的卸载与安装,但这次怎么都不成功。
 
实在没办法了,用Baidu搜了一下,可是结果很让我失望,中文网页里面竟然没有相关的内容,有的也只是简单的几条,心都凉了。还是google牛,把"Couldn't reserve space for cygwin's heap”输进去后网页一大堆,可惜我的英文还没有到火候,虽然基础不错,可是看到这么多的英文地址头都大了,无奈之下,先找最相似的,找了不少,可是都没用,大多数网页分为下面几类:
 
1、说的最多的是cygwin1.dll的版本问题,并且用词也不肯定,都是什么可能、或许,曾经听说过这样的词汇,可事实上,这一点我早就想到了,也试了n久,根本解决不了问题。
It sounds like you have another copy of the Cygwin DLL somewhere on your system, probably from a different version.
I have also had this issue.  I was able to correct the problem by the 
following steps:
1. Make sure that there is only one copy of cygwin1.dll on your computer
2. Clean up your PATH environment variable.
The order of the paths does matter.  The path closest to the front will 
have priority, especially when you have multiple cygwin1.dll's.
For example:
c:/gnuarm/bin;c:/cygwin/bin;c:/cygwin/usr/X11R6/bin;c:/winavr/bin/;
is different than
c:/winavr/bin/;c:/gnuarm/bin;c:/cygwin/bin;c:/cygwin/usr/X11R6/bin;


2、也有个别说是WinAVR版本的问题,解决方案就是卸载再安装,多试几次就OK了,这简直是碰运气,我也试过,都快把我弄崩溃了。
I did have the same problem beginning of this week. 
Formerly I always worked with WIN98 and it worked ok but now with WinXP.
I am not sure what it was but I think it had something to do with Turtoise CVS because it also uses Cygwin.
This is what I did to make it work again :
Uninstall WINAVR (build 20040404) 
Install WINAVR (build 20040404) >> Still did not work 
Uninstall Turtoise CVS >> WINAVR still did not work 
Uninstall WINAVR (build 20040404) 
Install WINAVR (build 20030424) >> Works (expect Progrs. Notepad but ok)! 
Install Turtoise CVS >> Keeps working 
Uninstall WINAVR (build 20030424) 
Install WINAVR (build 20040404) >> Everything works including PN)
Hope this works for you too
 
3、还有人说是电脑运行的其他的一些常驻内存的程序引起的,像杀毒软件什么的,关了的话就可以,我测试过,对我没什么用。
i found the problem. It seemed to be a problem with the available memory in the started shell. So i closed all "memory
resident" programs. The critical program was my firewall "Securepoint". After closing Securepoint every thing worked well.
I just found out the following after finally getting it back working.
1) The re-install didn't seem to help any 
2) Disabling Panda antivirus completely allowed it to run properly again 
3) After re-enabling anti-virus features one at a time, isolated the specific one that was causing the problem: "Blocking of
unknown threats / Enable behavioral analysis"
So with all antivirus features enabled but that one it works fine...
 
4、也有人提出说是Cygwin内存分配的问题,说内存分配的不够大,要修改注册表,我也照着做了,也没解决。可能对有的朋友有用,
原文如下:
By default no Cygwin program can allocate more than 384 MB of memory (program+data). You should not need to change this
default in most circumstances. However, if you need to use more real or virtual memory in your machine you may add an entry
in the either the HKEY_LOCAL_MACHINE (to change the limit for all users) or HKEY_CURRENT_USER (for just the current user)
section of the registry.
Add the DWORD value heap_chunk_in_mb and set it to the desired memory limit in decimal MB. It is preferred to do this in
Cygwin using the regtool program included in the Cygwin package. (For more information about regtool or the other Cygwin
utilities, see the section called “Cygwin Utilities” or use each the --help option of each util.) You should always be
careful when using regtool since damaging your system registry can result in an unusable system. This example sets memory
limit to 1024 MB:
regtool -i set /HKLM/Software/Cygnus/ Solutions/Cygwin/heap_chunk_in_mb 1024
regtool -v list /HKLM/Software/Cygnus/ Solutions/Cygwin

Exit all running Cygwin processes and restart them. Memory can be allocated up to the size of the system swap space minus any
the size of any running processes. The system swap should be at least as large as the physically installed RAM and can be
modified under the System category of the Control Panel.
 
5、也有人说跟环境变量、虚拟内存的大小有关,我试了也没用。
 
6、我最后的解决方式:rebase -b 0x76000000 c:/winavr/utils/bin/msys-1.0.dll,然后问题就解决了,主要参考的网站:
http://www.avrfreaks.net/index.php?module=PNphpBB2&file=viewtopic&t=37848&highlight=
My name is hyungon.kim (Korea) 
I got the same error message. 
-Couldn't reserve space for cygwin's heap, Win32 error 
487
I trying to several times to solve this problem. 
I searching and searching Internet many times. 
but I couldn't find a solution.

In 5~6 hours, finally I found it a solution.
solution--------------------------------------
first, You must have rebase.exe 
If you search Internet, you find easily, and downloading.
second, rebase -b 0x76000000 /winavr/utils/bin/msys-1.0.dll
0x76000000(examlple) -> you can change this address value 
properly, maybe Winavr is compiled well.


展开阅读全文

java.lang.OutOfMemoryError: Java heap space

06-05

程序如下,各位大哥,请不要转帖回答,我尝试了很多种方法没有解决。我打算用这个程序写成爬虫。请帮忙分析下原因,当爬到一万个url时,经常出现如标题错误。谢谢。rnimport java.io.BufferedReader;rnimport java.io.File;rnimport java.io.FileOutputStream;rnimport java.io.InputStreamReader;rnimport java.io.PrintStream;rnimport java.net.URL;rnimport java.util.ArrayList;rnimport java.util.HashMap;rnimport java.util.HashSet;rnimport java.util.LinkedHashSet;rnimport java.util.concurrent.ArrayBlockingQueue;rnimport java.util.concurrent.ThreadPoolExecutor;rnimport java.util.concurrent.TimeUnit;rnimport java.util.regex.Matcher;rnimport java.util.regex.Pattern;rnimport java.io.FileOutputStream; rn// 搜索Web爬行者rnpublic class SearchCrawler implements Runnable rnrn /*rn * disallowListCache缓存robot不允许搜索的URL。 Robot协议在Web站点的根目录下设置一个robots.txt文件,rn * 规定站点上的哪些页面是限制搜索的。rn * 搜索程序应该在搜索过程中跳过这些区域,下面是robots.txt的一个例子:rn * # robots.txt for http://somehost.com/ User-agent:rn * Disallow: /cgi-bin/rn * Disallow: /registration # Disallow robots on registration pagern * Disallow: /loginrn */rnrn private HashMap> disallowListCache = new HashMap>();rn HashSet crawledList = new HashSet();rn ArrayList errorList = new ArrayList();// 错误信息rn ArrayList result = new ArrayList(); // 搜索到的结果rn ArrayList disallowList;rn LinkedHashSet toCrawlList;rn URL robotsFileUrl;rn BufferedReader reader1;rn BufferedReader reader2;rn StringBuffer pageBuffer;rn Matcher m;rn URL verifiedLink;rn ArrayList linkList;rn //private int intThreadNum = 10;//线程数rn String startUrl;// 开始搜索的起点rn// int maxUrl;// 最大处理的url数rn URL verifiedUrl;rn Pattern p;rn Pattern p2;rn String searchString;// 要搜索的字符串(英文)rn boolean caseSensitive = false;// 是否区分大小写rn boolean limitHost = false;// 是否在限制的主机内搜索rnrn// public SearchCrawler(String startUrl, int maxUrl, String searchString) rnpublic SearchCrawler(String startUrl, String searchString) rn this.startUrl = startUrl;rn // this.maxUrl = maxUrl;rn this.searchString = searchString;rn rnrn public ArrayList getResult() rn return result;rn rnrn public void run() // 启动搜索线程rn // crawl(startUrl, maxUrl, searchString, limitHost, caseSensitive);rn crawl(startUrl, searchString, limitHost, caseSensitive);rn rnrn // 检测URL格式rn private URL verifyUrl(String url) rn // 只处理HTTP URLs.rn if (!url.toLowerCase().startsWith("http://"))rn return null;rn // URL verifiedUrl = null;rn verifiedUrl = null;rn try rn verifiedUrl = new URL(url);rn catch (Exception e) rn return null;rn rn return verifiedUrl;rn rnrn // 检测robot是否允许访问给出的URL.rn private boolean isRobotAllowed(URL urlToCheck) rn String host = urlToCheck.getHost().toLowerCase();// 获取给出RUL的主机rn // System.out.println("主机="+host);rnrn // 获取主机不允许搜索的URL缓存rn // ArrayList disallowList = disallowListCache.get(host);rn disallowList = disallowListCache.get(host);rn String disallowPath;rn int commentIndex;rn String disallow;rnrn // 如果还没有缓存,下载并缓存。rn if (disallowList == null) rn disallowList = new ArrayList();rn try rn // URL robotsFileUrl = new URL("http://" + host + "/robots.txt");rn robotsFileUrl = new URL("http://" + host + "/robots.txt");rn //BufferedReader reader1 = new BufferedReader(rn reader1 = new BufferedReader(rn new InputStreamReader(robotsFileUrl.openStream()));rnrn // 读robot文件,创建不允许访问的路径列表。rn String line;rn while ((line = reader1.readLine()) != null) rn if (line.indexOf("Disallow:") == 0) // 是否包含"Disallow:"rn // String disallowPath = line.substring("Disallow:"rn disallowPath = line.substring("Disallow:"rn .length());// 获取不允许访问路径rnrn // 检查是否有注释。rn // int commentIndex = disallowPath.indexOf("#");rn commentIndex = disallowPath.indexOf("#");rn if (commentIndex != -1) rn disallowPath = disallowPath.substring(0,rn commentIndex);// 去掉注释rn rnrn disallowPath = disallowPath.trim();rn disallowList.add(disallowPath);rn rn rn reader1.close();rn // 缓存此主机不允许访问的路径。rn disallowListCache.put(host, disallowList);rn catch (Exception e) rn return true; // web站点根目录下没有robots.txt文件,返回真rn rn rnrn String file = urlToCheck.getFile();rn // System.out.println("文件getFile()="+file);rn for (int i = 0; i < disallowList.size(); i++) rn // String disallow = disallowList.get(i);rn disallow = disallowList.get(i);rn if (file.startsWith(disallow)) rn return false;rn rn rnrn return true;rn rnrn private String downloadPage(URL pageUrl) rn try rn // Open connection to URL for reading.rn //BufferedReader reader2 = new BufferedReader(new InputStreamReader(rn reader2 = new BufferedReader(new InputStreamReader(rn pageUrl.openStream()));rnrn // Read page into buffer.rn String line;rn // StringBuffer pageBuffer = new StringBuffer();rn pageBuffer = new StringBuffer();rn while ((line = reader2.readLine()) != null) rn pageBuffer.append(line);rn rn reader2.close();rn return pageBuffer.toString();rn catch (Exception e) rn rnrn return null;rn rnrn // 从URL中去掉"www"rn private String removeWwwFromUrl(String url) rn int index = url.indexOf("://www.");rn if (index != -1) rn return url.substring(0, index + 3) + url.substring(index + 7);rn rnrn return (url);rn rnrn // 解析页面并找出链接rn private ArrayList retrieveLinks(URL pageUrl, String pageContents,rn boolean limitHost) rn //HashSet crawledList, boolean limitHost) rn // 用正则表达式编译链接的匹配模式。rn // Pattern p = Pattern.compile("]",rn p = Pattern.compile("]",rn Pattern.CASE_INSENSITIVE);rn // Matcher m = p.matcher(pageContents);rn m = p.matcher(pageContents); rn String link;rn String file;rn String path;rn int index;rn // ArrayList linkList = new ArrayList();rn linkList = new ArrayList();rn while (m.find()) rn // String link = m.group(1).trim();rn link = m.group(1).trim();rn if (link.length() < 1) rn continue;rn rnrn // 跳过链到本页面内链接。rn if (link.charAt(0) == '#') rn continue;rn rnrn if (link.indexOf("mailto:") != -1) rn continue;rn rnrn if (link.toLowerCase().indexOf("javascript") != -1) rn continue;rn rnrn if (link.indexOf("://") == -1) rn if (link.charAt(0) == '/') // 处理绝对地rn link = "http://" + pageUrl.getHost() + ":"rn + pageUrl.getPort() + link;rn else rn //String file = pageUrl.getFile();rn file = pageUrl.getFile();rn if (file.indexOf('/') == -1) // 处理相对地址rn link = "http://" + pageUrl.getHost() + ":"rn + pageUrl.getPort() + "/" + link;rn else rn // String path = file.substring(0,rn path = file.substring(0,rn file.lastIndexOf('/') + 1);rn link = "http://" + pageUrl.getHost() + ":"rn + pageUrl.getPort() + path + link;rn rn rn rnrn //int index = link.indexOf('#');rn index = link.indexOf('#');rn if (index != -1) rn link = link.substring(0, index);rn rnrn link = removeWwwFromUrl(link);rnrn // URL verifiedLink = verifyUrl(link);rn verifiedLink = verifyUrl(link);rn if (verifiedLink == null) rn continue;rn rnrn /* 如果限定主机,排除那些不合条件的URL */rn if (limitHostrn && !pageUrl.getHost().toLowerCase().equals(rn verifiedLink.getHost().toLowerCase())) rn continue;rn rnrn // 跳过那些已经处理的链接.rn if (crawledList.contains(link)) rn continue;rn rn //if(!crawledList.contains(link))rn linkList.add(link);rn rnrn return (linkList);rn rnrn // 搜索下载Web页面的内容,判断在该页面内有没有指定的搜索字符串rnrn private boolean searchStringMatches(String pageContents,rn String searchString, boolean caseSensitive) rn String searchContents = pageContents;rn /* if (!caseSensitive) // 如果不区分大小写rn searchContents = pageContents.toLowerCase();rn */rnrn //Pattern p2 = Pattern.compile("[\\s]+");rn p2 = Pattern.compile("[\\s]+");rn String[] terms = p2.split(searchString);rn for (int i = 0; i < terms.length; i++) rn if (caseSensitive) rn if (searchContents.indexOf(terms[i]) == -1) rn return false;rn rn else rn if (searchContents.indexOf(terms[i].toLowerCase()) == -1) rn return false;rn rn rn rnrn return true;rn rnrn rnrn 论坛

java heap space异常

06-25

我写的一段程序,实现每10s将远程数据库的信息写入到本地的数据库,这个程序能够运行正常,但超过10个小时左右就会报出java heap space异常,具体请看代码:rn[code=java]public class sy_car implements Runnable,remoteDBrnrn static Connection dbConn=null;rn ArrayList list=new ArrayList();rn locServer l=new locServer();rn static DataBaseConnection d=new DataBaseConnection();rn Statement stmt=null;rn rn public sy_car(JTextArea t)rn tryrn Class.forName(driverName);rn dbConn = DriverManager.getConnection(dbURL, userName, userPwd);rn rn t.append(utils.CommonFun.getCurrentTime()+":已经建立同GPS数据的同步\r\n");rn catch(Exception e)rn //e.printStackTrace();rn t.append(utils.CommonFun.getCurrentTime()+":"+"访问远程主机失败"+"\r\n");rn rn rn /**rn * @param argsrn */rn public void updateCar()rn list.clear();rn ResultSet rs=null;rn try rn stmt=dbConn.createStatement();rn String sql="select a.ClientID,b.isOpen,b.LocDate,b.Latitude,b.Longitude,b.Direction from ClientInfo a " +rn "left join CarMark b on a.ClientID=b.ClientID where CompanyID='1241'";rn rs=stmt.executeQuery(sql);rn int i=0;rn rn while(rs.next())rn TreeMap t=new TreeMap();rn t.put("ClientID", rs.getString("ClientID"));rn t.put("LocDate", rs.getString("LocDate"));rn t.put("Latitude", rs.getString("Latitude"));rn t.put("Longitude", rs.getString("Longitude"));rn t.put("Direction", rs.getString("Direction"));rn t.put("isOpen", rs.getString("isOpen"));//此处报出错误信息rn list.add(t);rn rn rn catch (Exception e) rn rn finallyrn try rn rs.close();rn stmt.close();rn catch (SQLException e) rn e.printStackTrace();rn rn rn rn rn for(int i=0,n=list.size();i 论坛

java.lang.outofmemoryerror java heap space

12-04

现在有一个很大的文件,大概有100w条记录,但是是按确定的格式,格式如下,现在想用java把记录填进数据库,数据库有两个字段,GID和GSEQ,分别存储>100000000和下面的字母。rn>100000000rnAATGGGGCCCGGAAGDDDrnDDDGGGGGGGGGGGGGGGrnDDDDDDDDDDrn>100000001rn...........rnjava代码如下:rntryrn rn BufferedReader fin = new BufferedReader(new FileReader("metaphlan_markers.fna"));rn //id=name=null;rn StringBuffer temp,strbuf;rn String str = null;rn boolean flag = false;rn //Pattern p = Pattern.compile("(\\d9)\\s(\\D*)");rn tryrn rn str = fin.readLine(); rn while(str!=null)rn rn //System.out.println(str);rn strbuf = new StringBuffer(str);rn //Matcher m = p.matcher(strbuf);rn temp = new StringBuffer();rn if(strbuf.charAt(0)=='>')rn rn if(temp!=null) rn rn //System.out.println(temp);rn tryrn String iquery = "insert into geneid_geneseq(GeneId,GeneSeq) values(?,?)";rn pstmt = conn.prepareStatement(iquery); rn pstmt.setString(1,strbuf.toString());rn pstmt.setString(2,temp.toString());rn pstmt.executeUpdate();rn catch(SQLException e)rn System.out.println("3");rn e.printStackTrace(); rn rn rn strbuf.deleteCharAt(0); rn //System.out.println(strbuf);rn rn else rn rn temp.append(str);rn rnrn //strbuf = new StringBuffer(fin.readLine());rn str = fin.readLine();rn //System.out.println(st);rn //System.out.println("st");rn rn catch(Exception e)rn String err = e.toString();rn System.out.println(err);rn rn catch(IOException e)rn System.out.println(e);rn rn每次程序都会报java heap space的错误,后来在运行程序时使用java a -Xms512m -Xmx512m后运行到50w条数据时就结束了,求解答。 论坛

java heap space

07-27

我用jxl把一个4500行49列的excel文件导入mysql时出现了题目所示的异常,查了网上的资料,说是内存溢出,可能是读入的文件太大了,把插入数据库语句屏蔽掉,运行没有问题,换了个500行的数据试了下,可以导入没问题,所以我判断是文件太大,无法一次写入数据库,那我怎样把4500行的excel表导入数据库,希望高手指点一下,谢谢!!rn异常报告:rnException in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap spacernat com.mysql.jdbc.PreparedStatement.(PreparedStatement.java:437)rnat com.mysql.jdbc.Connection.clientPrepareStatement(Connection.java:2187)rnat com.mysql.jdbc.Connection.prepareStatement(Connection.java:4829)rnat com.mysql.jdbc.Connection.prepareStatement(Connection.java:4734)rnat eetsoft.com.SubMenuActionDo.databasein(SubMenuActionDo.java:4576)rnat eetsoft.com.SubMenuActionDo.actionPerformed(SubMenuActionDo.java:464)rnat javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)rnat javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)rnat javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)rnat javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)rnat javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)rnat java.awt.Component.processMouseEvent(Component.java:6134)rnat javax.swing.JComponent.processMouseEvent(JComponent.java:3265)rnat java.awt.Component.processEvent(Component.java:5899)rnat java.awt.Container.processEvent(Container.java:2023)rnat java.awt.Component.dispatchEventImpl(Component.java:4501)rnat java.awt.Container.dispatchEventImpl(Container.java:2081)rnat java.awt.Component.dispatchEvent(Component.java:4331)rnat java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)rnat java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)rnat java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)rnat java.awt.Container.dispatchEventImpl(Container.java:2067)rnat java.awt.Window.dispatchEventImpl(Window.java:2458)rnat java.awt.Component.dispatchEvent(Component.java:4331)rnat java.awt.EventQueue.dispatchEvent(EventQueue.java:599)rnat java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)rnat java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)rnat java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)rnat java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)rnat java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)rnat java.awt.EventDispatchThread.run(EventDispatchThread.java:122) 论坛

没有更多推荐了,返回首页