out-of-memory

Encryption of video files?

一世执手 提交于 2019-12-17 03:28:13
问题 I am using this method for encrypting a video file: public static void encryptToBinaryFile(String password, byte[] bytes, File file) throws EncrypterException { try { final byte[] rawKey = getRawKey(password.getBytes()); final FileOutputStream ostream = new FileOutputStream(file, false); ostream.write(encrypt(rawKey, bytes)); ostream.flush(); ostream.close(); } catch (IOException e) { throw new EncrypterException(e); } } private static byte[] encrypt(byte[] raw, byte[] clear) throws

Parallel.ForEach can cause a “Out Of Memory” exception if working with a enumerable with a large object

落花浮王杯 提交于 2019-12-17 03:27:43
问题 I am trying to migrate a database where images were stored in the database to a record in the database pointing at a file on the hard drive. I was trying to use Parallel.ForEach to speed up the process using this method to query out the data. However, I noticed that I was getting an OutOfMemory Exception. I know Parallel.ForEach will query a batch of enumerables to mitigate the cost of overhead if there is one for spacing the queries out (so your source will more likely have the next record

“java.lang.OutOfMemoryError : unable to create new native Thread”

半腔热情 提交于 2019-12-17 02:58:14
问题 We are getting "java.lang.OutOfMemoryError : unable to create new native Thread " on 8GB RAM VM after 32k threads (ps -eLF| grep -c java) However, "top" and "free -m" shows 50% free memory available . JDk is 64 bit and tried with both HotSpot and JRockit.Server has Linux 2.6.18 We also tried OS stack size (ulimit -s) tweaking and max process(ulimit -u) limits, limit.conf increase but all in vain. Also we tried almost all possible of heap size combinations, keeping it low, high etc. The script

Out of Memory Error ImageView issue

本秂侑毒 提交于 2019-12-17 02:45:08
问题 I'm new in Android programming and I got an error that says that my app run out of memory, this exampled I copied from a book and it is working with small pictures resolution, but when I added a few pictures with a bigger resolution out of memory error appears, may be I do something wrong or just don't know all I should yet to work with images, if anyone know what should i change so that this error won't appear again, pleas help. Thank you anticipate! The source code: public class

High resolution Image - OutOfMemoryError

无人久伴 提交于 2019-12-17 02:37:38
问题 I am developing an application for the Galaxy S4. One of the requirements of the application is having a SplashScreen containing an Image of 1920x1080 pixels. Its a high quality .jpeg image and the size of the Image is about 2 Megabytes . The problem is that I am getting an OutOfMemoryError as soon as I start the Application. I am quite stunned that this already happens with an image of just 2 megabyte in size? How can I fix this problem and display the image? Changing the dimensions or the

Is it possible to catch out of memory exception in java? [duplicate]

北城余情 提交于 2019-12-17 01:01:21
问题 This question already has answers here : How to handle OutOfMemoryError in Java? [duplicate] (14 answers) Closed 6 years ago . I'm developing a program that would require huge amount of memory, and I want to catch when out-of-memory exception happens. I had heard this is not possible to do, but curious if there is any development on this end. 回答1: It's not an exception; it's an error: java.lang.OutOfMemoryError You can catch it as it descends from Throwable: try { // create lots of objects

Can't open lucene index (Java heap space)

99封情书 提交于 2019-12-16 18:06:29
问题 I want to grab some data from lucene index file. But I can't read it. I try to use Luke , but it always crashes with java.lang.OutOfMemoryError: Java heap space . Note -Xmx can't help me. I try -Xmx512, -Xmx1024 and even -Xmx2048. I try to use Solr also, but gets java.lang.OutOfMemoryError: Java heap space too. Any ideas how I can extract some data from Lucene? P. S. I use lucene 2.3.0. My index file is 1.8 Gb size. 回答1: What size is the data you are trying to fetch? Maybe the result set is

Memory Leak Error Android [closed]

旧巷老猫 提交于 2019-12-16 18:05:12
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . InputSream backgroundBitmap; //backgroundBitmap is initialized from asset image.png immutableBitmap = BitmapFactory.decodeStream(backgroundBitmap); getting this error: java.lang.OutOfMemoryError at android

Java - Read a big file (few GB) without exception

99封情书 提交于 2019-12-14 04:24:25
问题 This question is very short. I have a File Datei.trec-3,99 GB and i read it with this code: public class Main { public static void main(String[] args) { byte[] content = null; try { content = Files.readAllBytes(Paths.get("D:", "Videos","Captures","Datei.trec")); } catch (IOException e) { e.printStackTrace(); } System.out.println(content); } } and this is the output: Exception in thread "main" java.lang.OutOfMemoryError: Required array size too large at java.nio.file.Files.readAllBytes(Unknown

Why do I get a System.OutOfMemoryException using NHibernate?

落花浮王杯 提交于 2019-12-14 03:59:20
问题 Below are the details of the error: Scenario: I'm iteration through a collection which contains a field with 'byte[]' as datatype. While iterating it is allocating byte array in lakhs. I guess this may be the suspect. Error details: Exception of type 'System.OutOfMemoryException' was thrown. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.