2
投票
2答案
1359 次观看

使用Psycopg2维持Python和Postgresql之间连续连接的最佳/最佳实践

我正在用Python开发的具有Postgresql 8.3的应用程序,该应用程序可以在局域网中的多台计算机上运行。 所有机器 1)从数据库服务器获取大量数据(假设数据库在2秒的时间内从一台计算机上获得了100个不同的查询),并且大约有10或11台计算机在执行此操作。 2)处理完数据机后,必须更新某些表(每1.5秒每台计算机大约3或4个更新/插入查询)。 我注意到的是,数据库有时由于异常终止服务器进程或冻结服务器计算机(需要硬重置)而关闭。 通过所有机器始终保持与数据库的恒定连接的方式,即使用Psycopg2(在Python中)建立连接后,它将保持活动状态,直到处理完成(可...

3
投票
4答案
946 次观看

VB6应用程序调用.NET DLL OutOfMemory异常

我们有一个VB6应用程序,可以调用.NET DLL。有时,在VB6应用程序运行了很长时间并多次调用.NET代码之后,即使计算机上有大量可用内存,.NET方面也会抛出OutOfMemory异常。VB6内存空间也接近极限。 .NET端是否保留一个单独的内存池?还是它属于VB6应用程序的内存池? 如果它是分开的,是否有办法查看它有多大?我的任务管理器中仅有的大量内存项是SQL Server和VB6应用程序(两者都是预期的)。 这种情况不会经常发生,但是一旦发生,很难确定为什么系统不会分配更多的内存。

5
投票
2答案
8485 次观看

使用Commons FileUpload的DiskFileItem上传大文件时,如何避免OutOfMemoryErrors?

将大(> 300MB)文件上传到时,出现OutOfMemoryErrors 使用Commons FileUpload 1.2.1的servlet。似乎很奇怪,因为 使用DiskFileItem的全部目的是为了防止(可能 较大的文件)。我使用的是默认尺寸 10KB的阈值,因此,所有这些都应加载到 堆吧?这是部分堆栈跟踪: java.lang.OutOfMemoryError at java.io.FileInputStream.readBytes(Native Method) at java.io.FileInputStream.read(FileIn...

55
投票
9答案
87142 次观看

是否有可能在Java中捕获内存不足异常?

我正在开发一个需要大量内存的程序,并且我想抓住内存不足异常发生的时间。我听说这是不可能的,但对此是否有所发展感到好奇。

3
投票
1答案
1741 次观看

Linq to Entities和SQL Server 2008 FileStream

后端:启用了FileStream的SQL Server 2008数据库 数据访问:对实体的限制 我有成千上万个pdf,它们当前位于文件服务器上。我想将这些pdf文件从文件服务器移到SQL Server 2008数据库中,以便我可以更轻松地管理它们。 作为概念证明(即-确保我正在寻找SQL Server 2008中的新FileStream功能),我编写了一个小应用程序,该应用程序通过实体框架。 该应用程序非常简单;这是代码: datReport report = new datReport(); report.ReportName = "ANL-7411-Rev-Supp...

11
投票
4答案
21444 次观看

如何在Python中调试MemoryError?跟踪内存使用情况的工具?

我有一个Python程序,当我将其喂入大文件时会死于MemoryError。有什么我可以用来弄清楚内存使用情况的工具吗? 该程序在较小的输入文件上运行良好。该程序显然需要对可伸缩性进行一些改进。我只是想弄清楚在哪里。明智的人曾经说过:“优化之前先做基准”。 (只是阻止不可避免的“添加更多RAM”答案:这是在具有4GB RAM的32位WinXP机器上运行的,因此Python可以访问2GB的可用内存。从技术上讲,添加更多内存是不可能的。具有64位Windows的PC是不实用的。) 编辑:糟糕,这是建议使用哪个Python内存分析器的副本?

2
投票
4答案
11983 次观看

为什么在执行ASP .NET Excel Interop时出现内存不足错误?

此正在 ..我将处置代码移到了finally块,现在每次都失败了。 我有一个包含4条记录,6列长的测试电子表格。这是我用来引入它的代码。这是IIS 5(我的PC)和IIS 6(Web服务器)上的ASP .Net 3.5。 它在捕获之前的行上爆炸:“值=(object [,])range.Value2;”出现以下错误: 11/2/2009 8:47:43 AM :: Not enough storage is available to complete this operation. (Exception from HRESULT: 0x8007000E (E_OUTOFMEMO...

0
投票
1答案
441 次观看

远程方法调用期间发生OutOfMemoryException

我在进行远程方法调用时遇到OutOfMemoryException。 “ RemoteEntity.SetLocalStore(DATASET);” 传递的值是数据集。 注意数据集的大小为38mb 开发C#VS2008 谢谢 代码: private void backgroundSync_DoWork(object sender, DoWorkEventArgs e) { backgroundSync.ReportProgress(10, "Fetching data for sync ..."); ...

24
投票
5答案
3651 次观看

Linux乐观的malloc:当内存不足时,new总是会抛出吗?

我一直在了解Linux上的内存不足情况,手册页中的以下段落让我开始思考: 默认情况下,Linux遵循乐观的内存分配策略。这意味着当malloc()返回非NULL时,不能保证内存确实可用。这是一个非常糟糕的错误。万一发现系统内存不足,臭名昭著的OOM杀手将杀死一个或多个进程。[...] 考虑到运算符new的实现最终会在某个时刻调用malloc,是否可以保证new实际上会在Linux上抛出?如果没有,该如何处理这种显然无法检测到的错误情况?

4
投票
6答案
8030 次观看

Java内存泄漏

有人使用Eclipse内存管理器来检测Java代码中的内存泄漏吗?有人可以推荐一个不错的地方来查找有关使用内存管理器的信息吗?我在网上阅读了一些东西,这表明我需要让程序运行直到崩溃(发生内存不足错误),这将生成崩溃报告。然后使用内存管理器打开此报告以检查可能发生内存泄漏的位置。这是每个人使用内存管理器的方式吗?

5
投票
4答案
2392 次观看

内存不足异常

OutofMemory异常的可能原因是什么。 内存分配应由GC处理。 已为正常的.NET / C#应用程序分配了多少内存? 在我们的应用程序中,它位于Stream.ReadToEnd()和DataTable.WriteXml(Memory stream)函数之类的不同位置。 环境是.Net C#

2
投票
3答案
6871 次观看

WCF Web服务上的System.OutOfMemoryException

在执行要创建许多对象的导入过程时,我遇到了System.OutOfMemoryException。 其结果是ASPNET_WP.EXE的大小达到1.4 GB,并且会引发异常。 我已经尝试实现IDisposable并在该负责的函数中调用垃圾收集器(GC.Collect()),但没有效果。 服务器是具有4 GB RAM的QuadCore(C2Q)。即使RAM可用空间超过1,4 GB,当aspnet_wp.exe达到1.4 GB时,也会始终引发异常。 如何避免这些内存不足的问题? 确切的异常消息是: System.OutOfMemoryException: Exception o...

97
投票
11答案
289430 次观看

java.lang.OutOfMemoryError: Java heap space

I am getting the following error on execution of a multi-threading program java.lang.OutOfMemoryError: Java heap space The above error occured in one of the threads. Upto my knowledge, Heap space is occupied by instance variables only. If this is correct, then why this error occurred after r...

0
投票
3答案
2086 次观看

CComBSTR memory allocation

I have a "const char* str" with a very long string. I need to pass it from a cpp client to a .Net COM method which expects BSTR type. Currently I use: CComBSTR bstr = str; This has the following issues: Sometimes this line fails with out of memory message When I pass the bstr to the COM clas...

11
投票
4答案
2179 次观看

OutOfMemory, but no gcroots for many objects

We are developing a rather large Windows Forms application. In several customers' computers it often crashes with OutOfMemory exception. After obtaining full memory dump of the application moments after the exception (clrdump invoked from UnhandledException handler) I analyzed it with ".NET Memor...

6
投票
1答案
911 次观看

OutOfMemoryError in a separate Java thread

Consider that I have a main Thread which executes a new Runnable in a new Thread. Now, while the new Thread is executing, the Java VM runs out of memory and throws an OutOfMemoryError. What happens? Does the target thread stop? Will the main thread continue? When the new Thread crashes, will the...

5
投票
4答案
8226 次观看

Troubleshooting ERROR_NOT_ENOUGH_MEMORY

Our application is failing on one specific user's computer with ERROR_NOT_ENOUGH_MEMORY ("Not enough storage is available to process this command"). The error is apparently being raised somewhere deep within the Delphi VCL framework that we're using, so I'm not sure which Windows API function is...

6
投票
3答案
4829 次观看

JVM throws OutOfMemory during gc though there are plenty memory left

I have my java application configured to use 5G memory. I got an OutOfMemory out of blue. I inspected the gc log and found plenty of memory left: young generation occupies 4% allocated space, tenure generation occupancy is 5% and perm generation is 43%. I am puzzled why JVM throws an OutOfMemory ...

1
投票
2答案
965 次观看

Eclipse's .ini settings don't seem to be helping me change the max heap size

Here is my eclipse.ini file: -startup plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519 -product org.eclipse.epp.package.java.product --launcher.XXMaxPermSize 256M -showsplash org.eclipse.platform ...

1
投票
1答案
1179 次观看

Opening a simple OleDB connection throws OutOfMemory Exception?

I am having troubles with one of our applications. It's .NET 3.5 32 bits process. Upon startup we open a .mdb to read a few "metadata" values. This works on hundreds of systems, but we have a customer with a TabletPC and problems. The operating system is Windows XP Tablet PC SP3, 32 bits, bla bla...

11
投票
5答案
10689 次观看

string.split() "Out of memory exception" when reading tab separated file

I am using string.split() in my C# code for reading tab separated file. I am facing "OutOfMemory exception" as mentioned below in code sample. Here I would like to know why problem is coming for file having size 16 MB? This is right approach or not? using (StreamReader reader = new StreamRea...

826
投票
20答案
913735 次观看

Error java.lang.OutOfMemoryError: GC overhead limit exceeded

I get this error message as I execute my JUnit tests: java.lang.OutOfMemoryError: GC overhead limit exceeded I know what an OutOfMemoryError is, but what does GC overhead limit mean? How can I solve this?

4
投票
1答案
1451 次观看

Ocaml "Out of memory" exception; verbose mode says "Stack overflow in structural comparison"

A very huge ocaml program from an alien source needs to be fixed. One of the problem is that the program crashes at seemingly innocent line: Hashtbl.mem loc_to_no loc with "Out of memory" exception. The thing is that there's surely enough memory out there and this line is executed just fine ...

2
投票
1答案
564 次观看

.NET System.OutOfMemoryException and AppDomains

I have a plugin manager that launches a plugin which connects to a FoxPro database through the ADO.NET OLE DB provider. At one client site connections are opened and closed without any problems but at another client site, it gets stuck in 'connection.Open();' and within a couple of seconds ov...

4
投票
2答案
1457 次观看

Understanding .NET GC and OutOfMemory Exceptions

I'm troubleshooting an OutOfMemory exception in my .NET 2.0 Windows Service application. To understand the issue better I began by writing a simple .NET WinForm test app that generates an OOM Exception by building an ArrayList until an OOM Exception is thrown. The exception is caught and logged...

8
投票
9答案
10008 次观看

How to detect Out Of Memory condition?

I have an application running on Websphere Application Server 6.0 and it crashes nearly every day because of Out-Of-Memory. From verbose GC is certain there are the memory leaks(many of them) Unfortunately the application is provided by external vendor and getting things fixed is slow & pai...

1
投票
1答案
1530 次观看

System.OutOfMemoryException importing Page with a single large DataGrid into Excel (Quick Fix)

We use Excel for a number of ad-hoc pivots / reports. To get the data into Excel we have a general page with a simple DataGrid that we bind from a DataSet / DataTable. We "Import External Data" using this URL in Excel. Unfortunately we have a query that returns around 100 columns and 40k rows. ...

4
投票
3答案
2538 次观看

Resharper throws OutOfMemoryException on big solution

IDE Configuration: Visual Studio 2008 + Resharper 4.5.1 + Agent Smith 1.1.8. There is no any sophisticated configuration for last to add-ins. Solution description: 33 class libraries + web site with 200+ pages. Symptoms: After an hour of work under tuned on Resharper the IDE starts to throw...

4
投票
7答案
8811 次观看

Merging 1000 PDF thru iText throws java.lang.OutOfMemoryError: Java heap space

I am trying to merge 1000 PDF Files thru iText. I am not sure where the memory leakage is happening. Below is the sample code. Note that i am removing the child-pdf file as soon as i merge to the parent file. Please pointout bug in below code or is there any better way to do this with out memory ...

1
投票
2答案
3311 次观看

Memory shortage problem while using BufferedImage and ImageIO to save images

I want to save some java.awt.Image objects into the disk. But when I try like: for (Image image : images) { image = new ImageIcon(image).getImage(); BufferedImage temp = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_INT_RGB); Graphics2D g = temp.cr...