out-of-memory

ASP.NET MVC: Returning large amounts of data from FileResult

一世执手 提交于 2019-12-07 01:38:33
问题 I have a file browser application in MVC4 that allows you to download a selected file from a controller. Currently, the FileResult returns the Stream of the file, along with the other response headers. While this works fine for smaller files, files that are larger generate an OutOfMemoryException. What I'd like to do is transmit the file from the controller, without buffering in memory in a fashion similiar to HttpReponse.TransmitFile in WebForms. How can this be accomplished? 回答1: You can

how to correct this error: java.lang.OutOfMemoryError

孤者浪人 提交于 2019-12-07 00:07:41
问题 This is my code: public void onPictureTaken(byte[] data, Camera camera) { Bitmap foto = BitmapFactory.decodeByteArray(data, 0, data.length); wid = foto.getWidth(); hgt = foto.getHeight(); Bitmap newImage = Bitmap.createBitmap(wid, hgt, Bitmap.Config.ARGB_4444); Canvas canvas = new Canvas(newImage); canvas.drawBitmap(foto, 0f, 0f, null); if (newImage.getWidth() > newImage.getHeight()) { Matrix matrix = new Matrix(); matrix.postRotate(90); newImage.createBitmap(newImage, 0, 0, wid, hgt, matrix,

How can I debug misleading GDI OutOfMemory exceptions?

放肆的年华 提交于 2019-12-06 22:30:28
I have a function which resizes a bitmap. It's such a "bread and butter" operation that I simply copied it from another project: private Bitmap ResizeBitmap(Bitmap orig) { Bitmap resized = new Bitmap(this.Xsize, this.Ysize, PixelFormat.Format16bppGrayScale); resized.SetResolution(orig.HorizontalResolution, orig.VerticalResolution); using (Graphics g = Graphics.FromImage(resized)) { g.DrawImage(orig, 0, 0, resized.Width, resized.Height); } return resized; } However, I kept getting OutOfMemory exceptions on Graphics g = Graphics.FromImage(resized) . I'm aware that, when it comes to GDI,

Errno::ENOMEM: Cannot allocate memory - cat

我与影子孤独终老i 提交于 2019-12-06 19:37:30
问题 I have a job running on production which process xml files. xml files counts around 4k and of size 8 to 9 GB all together. After processing we get CSV files as output. I've a cat command which will merge all CSV files to a single file I'm getting: Errno::ENOMEM: Cannot allocate memory on cat (Backtick) command. Below are few details: System Memory - 4 GB Swap - 2 GB Ruby : 1.9.3p286 Files are processed using nokogiri and saxbuilder-0.0.8 . Here, there is a block of code which will process 4

MTOM not working when using SOAPHandler

自作多情 提交于 2019-12-06 16:34:26
I try to transfer file with Mtom and it is working pretty good until i use SoapHandler to verify client signature. SoapHandler keeps all message and changes it to base64 encoded. So when i try to get huge file, Jvm throws heap size exception. Do you guys know any ways to solve this problem? The Java JRE comes with a JAX-WS Provider. This provider has what I would consider a bug. If a SoapHandler is added, either by directly getting the HandlerChain or by using a HandlerResolver, the message, which was correctly created using MTOM, is deconstructed and the attachment(s) are placed inline within

How to make sure Android bitmaps are cleared out of Heap

只愿长相守 提交于 2019-12-06 15:48:00
I have an activity (activity1) which uses a decently large amount of bitmaps. I also have another activity which loads bitmaps (activity2). When running on some phones, I get an OOM error in activity2. I've tracked down the error to being caused by the layout in activity1. If I take out all of the bitamps in activity1, and replace them with just hex colors, then I do not get an OOM error in activity2. So from this I'm assuming that the bitmaps I'm using in activity1 are not being removed from the heap when activity1's onPause or onDestroy methods are called. So far I've tried the answer from

VS Express 2012 in Windows 8.1 - getting Out of memory exception

为君一笑 提交于 2019-12-06 14:52:58
问题 While running the VS 2012 application, getting an out of memory exception. This is occuring in debug and release mode and on initial load itself on my development machine. Even I'm getting the same error on a new asp.net (default) application I already looked at the solutions for similar issues on other threads and none of them worked in this scenario. Can some one help me on this? Exception of type 'System.OutOfMemoryException' was thrown. Description: An unhandled exception occurred during

Out of memory when using `outer` in solving my big normal equation for least squares estimation

∥☆過路亽.° 提交于 2019-12-06 14:48:37
Consider the following example in R: x1 <- rnorm(100000) x2 <- rnorm(100000) g <- cbind(x1, x2, x1^2, x2^2) gg <- t(g) %*% g gginv <- solve(gg) bigmatrix <- outer(x1, x2, "<=") Gw <- t(g) %*% bigmatrix beta <- gginv %*% Gw w1 <- bigmatrix - g %*% beta If I try to run such a thing in my computer, it will throw a memory error (because the bigmatrix is too big). Do you know how can I achieve the same, without running into this problem? This is a least squares problem with 100,000 responses. Your bigmatrix is the response (matrix), beta is the coefficient (matrix), while w1 is the residual (matrix

Google API MapView OutOfMemory after setting the MapView to specific width and height

徘徊边缘 提交于 2019-12-06 14:27:04
i searched for this Problem, and i found some stackoverflow Questions about the same but without any idea how to resolve the problem. I created an activity and i want to add a really small mapview (like 140w X 70h). It is only to show a small preview of where the place is. When you click this little mapview you get a new inflate to a new activity with the hole map. MapView: <com.google.android.maps.MapView android:id="@+id/mapview" android:layout_width="140dip" android:layout_height="80dip" android:layout_below="@id/attributes" android:layout_alignParentRight="true" android:apiKey="****"

Cassandra Cluster - Specific Node - specific table high Dropped Mutations

杀马特。学长 韩版系。学妹 提交于 2019-12-06 14:02:44
My Compression strategy in Production was LZ4 Compression. But I modified it to Deflate For compression change, we had to use nodetool Upgradesstables to forcefully upgrade the compression strategy on all sstables But once upgradesstabloes command completed on all the 5 nodes in the cluster, My requests started to fail, both read and write The issue is traced to a specific node out of the 5 node cluster and to a spcific table on that node. My whole cluster has roughly same amount of data and configuration , but 1 node in particular goes down is misbehaving Output of nodetool status |/ State