out-of-memory

excessive memory use by java

我是研究僧i 提交于 2019-12-30 10:27:04
问题 In a project of mine I constantly compress little blocks of data. Now I find out that the jvm then grows to 6GB of ram (resident (RES) RAM, not shared or virtual or so) and then die because of out of memory. It is as if the garbage collector never runs or so. I've pulled out the relevant code and pasted it below. When I run it (java6, 32 bit linux) it grows to 1GB of ram. Anyone got an idea how to reduce the memory usage? import java.util.Random; import java.util.zip.Deflater; import java

Why there are no OutOfMemoryError subclasses?

≡放荡痞女 提交于 2019-12-30 09:08:31
问题 As we all know, there are multiple reasons of OutOfMEmoryError (see first answer). Why there is only one exception covering all these cases instead of multiple fine-grained ones inheriting from OutOfMEmoryError ? 回答1: I'd expect because you really can't do anything else when that happens: it almost doesn't matter WHY you ran out, since you're screwed regardless. Perhaps the additional info would be nice, but... I know tomcat tries to do this "Out Of Memory Parachute" thing, where they hold

OutOfMemoryException for a vb.net application

喜夏-厌秋 提交于 2019-12-30 08:27:08
问题 In one of my VB.Net applications i am getting error while running the application. This error does not come always. So i am not able to reproduce the error also. No exact sequence also to reproduce the error. Stack :System.OutOfMemoryException: Out of memory. at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc) at System.Windows.Forms.ToolStrip.OnPaint(PaintEventArgs e) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System

How to catch OutOfMemoryError in JVM and run a script if it's caught?

自古美人都是妖i 提交于 2019-12-30 06:15:49
问题 I have a program that sometimes throw OOME, I understand that there is a flag in the JVM options that I can set and whenever a certain Error/Exception appears (such as OOME) it calls a script I wrote. The script will give the user a notification and will call a the program with a different argument so it won't get OOME again. does anyone know how to set this flag? what is the JVM options I need to set? I looked everywhere on line and couldn't find the answer. help me please! Thanks, Aye 回答1:

I hit an OutOfMemoryException with List<string> - is this the limit or am I missing something?

99封情书 提交于 2019-12-30 05:50:07
问题 Given the opportunity to rewrite, I would, but anyway, the code as it stands: List<string> foobar; Then we add a bunch of strings to foobar. At count=16777216, we hit an out of memory limit. My understanding is that each string would be a different size. Indeed looking at the data (not my data), most are 2 or 3 characters. what is the max limit of data into list in c#? indicates that the max limit is: The maximum number of elements that can be stored in the current implementation of List is,

How to troubleshoot Out Of Memory error on Production system

倾然丶 夕夏残阳落幕 提交于 2019-12-30 05:29:25
问题 We are using JBoss_4_0_4_GA with JDK 1.5.0 (no updates) on a Windows The JBoss server is run within a Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org. Since the JVM is so old I cannot even use the -XX:+HeapDumpOnOutOfMemoryError option on the JVM. What are my option to find out the issue? As usual the Out of Memory exception is happening on different parts of the application. I do not have the liberty to upgrade the JVM right away. The current VM settings Java Additional Parameters

Linked ViewScoped beans lead to memory leaks

[亡魂溺海] 提交于 2019-12-30 03:13:29
问题 In our JavaEE6 project (EJB3, JSF2) on JBoss 7.1.1, it seems we have a memory leak with @ViewScoped beans. Last tree days I've spent time on this issue investigation. So i've created simple project with two pages to guarantee that after first page leaving @ViewScoped bean will be released. <context-param> //web.xml <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>server</param-value> </context-param> <context-param> <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name

Create animated splash screen using frames on Android

帅比萌擦擦* 提交于 2019-12-29 08:01:57
问题 So here's the deal, I've searched every single question and link online but none are helpful. I have 120 frames of an animation in .jpg format for my splash screen. I understand that jpegs are converted to bitmaps on memory so that's why I get an OutOfMemoryError. The maximum frames I get to animate are 10. Is there any way to do this frame by frame, or should I try something else. Here's my code: final AnimationDrawable anim = new AnimationDrawable(); anim.setOneShot(true); for (int i = 1; i

Big XML file and OutOfMemoryError

ぐ巨炮叔叔 提交于 2019-12-29 07:19:26
问题 I’m trying to parse a XML file up to 500 mb in java. I tried to use SAX but it gives me this error java.lang.OutOfMemoryError: Java heap space at com.sun.org.apache.xerces.internal.util.XMLStringBuffer.append(Unknown Source) Can you help me? Thanks a lot. P.S. Smaller XML files works just fine 回答1: Most likely you're not using SAX correctly, or your application isn't suited for stream processing. The whole point of SAX is to avoid keeping the entire XML structure in memory, but that's only

OutOfMemoryException in Regex Matches when processing large files

断了今生、忘了曾经 提交于 2019-12-29 07:11:58
问题 I've got an exception log from one of production code releases. System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.Text.RegularExpressions.Match..ctor(Regex regex, Int32 capcount, String text, Int32 begpos, Int32 len, Int32 startpos) at System.Text.RegularExpressions.RegexRunner.InitMatch() at System.Text.RegularExpressions.RegexRunner.Scan(Regex regex, String text, Int32 textbeg, Int32 textend, Int32 textstart, Int32 prevlen, Boolean quick) at