out-of-memory

Android Bitmap OutOfMemoryError [duplicate]

。_饼干妹妹 提交于 2019-12-08 06:46:06
问题 This question already has answers here : Android: BitmapFactory.decodeStream() out of memory with a 400KB file with 2MB free heap (7 answers) Closed 6 years ago . I'm having an OutOfMemoryError in my VSD220 (It's a 22" Android based All in one) for (ImageView img : listImages) { System.gc(); Bitmap myBitmap = BitmapFactory.decodeFile(path); img.setImageBitmap(myBitmap); img.setOnClickListener(this); } I really don't know what to do, because this image is below the maximum resolution. The

Memory issue with my Android app

两盒软妹~` 提交于 2019-12-08 06:44:29
Hi my Android application is working fine on my Lenovo a319 device , in this device it consuming 40 MB of RAM meanwhile on the Galaxy s5 Device , it consuming 300 Mb for the same build(apk). And I am getting lot of errors such as memory issue on Galaxy s5 device. For Instance Out of memory exception and android.view.InflateException: Binary XML file line errors. I have found this Question where it is answered that high pixel resolution will cause memory exception , I am not able to get any clue from that answers provided in that Question , kindly provide the support on the same? EDIT: Thanks

android. How to conserve memory with custom ArrayAdapters and ViewPagers

痴心易碎 提交于 2019-12-08 06:32:27
问题 So I have a MainActivity with a View Pager. I create a nonstatic custom FragmentPageAdapter for the View Pager like this: public class CustomViewPageAdapter extends FragmentStatePagerAdapter { The Adapter has 4 items(fragments) Which I declare as global variables MainActivity as static so for example: static HotFragment hotFragment; Then I return hotFragment in my getItem() method of the FragmentStatePagerAdapter. Then in my HotFragment class I have another ViewPager as well as another

Android out of memory exception with bitmaps

青春壹個敷衍的年華 提交于 2019-12-08 06:26:06
问题 First off, I have read many posts and articles about out of memory exceptions but none of them have helped with my situation. What I'm trying to do is load an image from the sd card but scale it to an exact pixel size. I first get the width and height of the image and calculate the sample size: final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(backgroundPath, options); // Calculate inSampleSize options.inSampleSize =

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

主宰稳场 提交于 2019-12-08 06:11:16
问题 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? 回答1: This is a least squares problem with 100,000 responses.

How to free up memory after base64 convert

夙愿已清 提交于 2019-12-08 05:52:09
问题 I am trying to stream the contents of a file. The code works for smaller files, but with larger files, I get an Out of Memory error. public void StreamEncode(FileStream inputStream, TextWriter tw) { byte[] base64Block = new byte[BLOCK_SIZE]; int bytesRead = 0; try { do { // read one block from the input stream bytesRead = inputStream.Read(base64Block, 0, base64Block.Length); // encode the base64 string string base64String = Convert.ToBase64String(base64Block, 0, bytesRead); // write the

Python - How to stream large (11 gb) JSON file to be broken up [duplicate]

て烟熏妆下的殇ゞ 提交于 2019-12-08 05:13:35
问题 This question already has answers here : Opening A large JSON file in Python (3 answers) Closed 10 months ago . I have a very large JSON (11 gb) file that is too large to read into my memory. I would like to break it up into smaller files to analyze the data. I am currently using Python and Pandas for the analysis and I am wondering if there is some way to access chunks of the file so that it can be read into memory without crashing the program. Ideally, I would like to break the years worth

How to detect out-of-memory segfaults?

ぃ、小莉子 提交于 2019-12-08 04:30:43
问题 How does one detect whether a segfault is being caused by an out-of-memory condition? I have a segfault that defies diagnosis by valgrind and duma/efence because it seems to crash those tools themselves (Valgrind "the impossibe happened", duma: "mprotect() failed: Cannot allocate memory" ) The application (Gazebo) simply crashes with a segfault, and a stack trace that doesn't seem to offer many hints as to why. TLDR: Is there an easy tool or method to either confirm or rule out the out-of

How can I get an OutOfMemoryException in .Net?

穿精又带淫゛_ 提交于 2019-12-08 04:28:19
问题 In a memory hungry app I'm developing I'm facing OutOfMemoryExceptions. I expected to never have this kind of exceptions with virtual memory. Why if it is needed more RAM than available the OS is not using the HD as RAM? 回答1: You can get an OutOfMemoryException in many different ways. In 32-bit windows, a process can use 2GB of virtual address space (I believe it's 1TB in 64-bit applications). Keep in mind this is not RAM, it is completely different, hence "virtual". So forget about RAM. All

How can I debug misleading GDI OutOfMemory exceptions?

我怕爱的太早我们不能终老 提交于 2019-12-08 04:03:38
问题 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