out-of-memory

ASP.NET C# OutofMemoryException On Large File Upload

自古美人都是妖i 提交于 2019-12-09 13:25:05
问题 I have the following file upload handler: public class FileUploader : IHttpHandler { public void ProcessRequest(HttpContext context) { HttpRequest request = context.Request; context.Response.ContentType = "text/html"; context.Response.ContentEncoding = System.Text.Encoding.UTF8; context.Response.Cache.SetCacheability(HttpCacheability.NoCache); var tempPath = request.PhysicalApplicationPath + "\\Files\\TempFiles\\"; byte[] buffer = new byte[request.ContentLength]; using (BinaryReader br = new

Why is Internal memory in java Native Memory Tracking increasing

夙愿已清 提交于 2019-12-09 13:19:01
问题 My application is running in a docker container, it use scala and use "OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)", its Xmx is set to be 16GB and container memory limit is 24Gb, after running for some time the container is killed: Last State: Terminated Reason: OOMKilled Exit Code: 137 However I can't find any "java.lang.OutOfMemoryError: Java heap space" errors in the log, not even once in last 2 weeks in all 48 nodes. So it's not likely a normal heap OOM. dmesg output: $ dmesg

StringBuilder out of memory error when working with large strings in java

感情迁移 提交于 2019-12-09 12:28:43
问题 I went from String test += str; where test grew exponentially large with thousands and thousands of characters. It took 45 minutes to run, probably from creating large strings and deleting garbage. I then staggered the input like this which brought it to 30 seconds. This seems like the cheap way to do it, but it worked well: if (secondDump.length() > 50) { intermedDump = intermedDump + secondDump; secondDump = ""; } if (intermedDump.length() > 100) { thirdDump = thirdDump + intermedDump;

How to free up memory?

孤街醉人 提交于 2019-12-09 08:01:03
问题 We have been facing Out of Memory errors in our App server for sometime. We see the used heap size increasing gradually until finally it reaches the available heap in size. This happens every 3 weeks after which a server restart is needed to fix this. Upon analysis of the heap dumps we find the problem to be objects used in JSPs. Can JSP objects be the real cause of Appserver memory issues? How do we free up JSP objects (Objects which are being instantiated using usebean or other tags)? We

setting wallpaper through code

岁酱吖の 提交于 2019-12-09 07:12:29
问题 I was trying to make an app which also had the facility to let user select wallpaper he would like to set. I have managed this by calling the Gallery Intent. Once the user selects a specific image, the data path of the image is returned to me which then i preview to the user by setting the image onto an imageview. The problem crops up when the image size (and/or resolution) is greater than what android expects. This results in failure of my module. And as if this was not enough, wen the user

force close the application

风流意气都作罢 提交于 2019-12-09 02:03:58
问题 I am new to android and stuck up with an issue. I want to know how to force close the application programmatically and restart it again. I am trying this because i am really stuck up with OutOfMemmoryError i want to free up the memory and restart the app again. Please guide me if i am wrong. 回答1: Restarting the app to avoid or repair OutOfMemoryExceptions is a very bad idea. You should start to work on your memory issue itself instead of just do weird things when they occur. You should heal

ImageList / Image OutOfMemoryException

余生颓废 提交于 2019-12-09 01:00:24
问题 I'm suffering from an OutOfMemoryException when obtaining an Image from an ImageList I've been unable to find an appropriate solution to the problem. I've got a Custom ListView control, which has attached to it an Event for the drawing of ListViewItems. This then calls a static method which is designed to draw the item. For a ListView of around 300 items, we're getting the memory jump up around 100Mb each time the ListView is scrolled. The offending code has been tracked down to the following

Posting a large file in Android

我只是一个虾纸丫 提交于 2019-12-08 22:31:14
问题 I sometimes get an OutOfMemoryError when posting a large file in Android. This is the code I'm using. Am I doing something wrong? HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setRequestMethod("POST"); con.setDoInput(true); con.setDoOutput(true); ostream = new DataOutputStream(con.getOutputStream()); byte[] buffer = new byte[1536]; int count; while ((count = fileInput.read(buffer)) != -1) { ostream.write(buffer, 0, count); // This sometimes causes OutOfMemoryError }

JUnit java.lang.OutOfMemoryError when running all tests in a package

送分小仙女□ 提交于 2019-12-08 21:26:44
问题 When loading all unit tests in a package, the make task throws a java.lang.OutOfMemoryError: Java heap space error. If I run all the tests in each subpackage, though, all tests load and complete just fine. It is only when I try to run all tests in the parent package that the OOM error occurs. I don't think this problem should be solved by tweaking VM parameters. I tried increasing the maximum heap and perm size, and it didn't solve the problem. This leads me to believe there is some problem

Java: OutOfMemoryError Exception and freeMemory()

假装没事ソ 提交于 2019-12-08 20:35:16
问题 I have the following test program: public static void main(String[] args) { HashMap<Integer, String> hm = new HashMap<Integer,String>(); int i = 1; while(true) { hm.put(i, "blah"); i++; System.out.println("############"); System.out.println("Max mem: " + Runtime.getRuntime().maxMemory()); System.out.println("Total mem: " + Runtime.getRuntime().totalMemory()); System.out.println("Free mem:" + Runtime.getRuntime().freeMemory()); } } If I run this program, I get the follwing output: ... ########