Memory « File Attribute « Java I/O Q&A





1. What is the easiest way to have a custom file implementation that only uses memory in Java    stackoverflow.com

I have a code base that makes extensive use of files to represent a single data object. I have refactored the code so that the data object is now an ...

2. Java Memory model question    stackoverflow.com

I know maybe the answer to the question is obvious. But if anybody can give me a definitive answer, that would be helpful. The question is : whether the java NIO package ...

3. The right way to manage a big matrix in Java    stackoverflow.com

I'm working with a big matrix (not sparse), it contains about 10^10 double. Of course I cannot keep it in memory, and I need just 1 row at time. I thought to split ...

4. Java I/O memory usage question    stackoverflow.com

The flow of my application is somewhat like this: An input file consists of multiple logical documents:

  1. Extract one input logical document
  2. Parse the elements within the document
  3. Build an xml ...

5. Java in-memory file structure?    stackoverflow.com

I need to do a lot of things with resources on the fly: parsing xsd/xml docs, building and compiling java classes, package them into jars ans wars, persist in DB, deploy ...

6. In Java, how do I create a temp file only in memory?    stackoverflow.com

I'd like to read in an XML response and make a temp file in memory out of the xml. Then, I'd like to read in the file to see if certain elements ...

7. Using java to represent a file structure in memory?    stackoverflow.com

I'm trying to index a file structure (not actual data) relative to a specific path on my local disk. Initially I load the file structure to memory then listen for real ...

8. Memory management for a object that has a file.    stackoverflow.com

I was wondering if someone could explain the best solution for the smallest memory footprint for an object that has a file in the following situation...

  1. There could be 1 ...

9. Create a File object in memory from a string in Java    stackoverflow.com

I have a function that accepts File as an argument. I don't want to create/write a new File (I don't have write access to filesystem) in order to pass my string ...





10. Fast memory manipulation in Java?    stackoverflow.com

I am a bit of a newbie to Java (prior experience with C on embedded platforms), so please forgive me if this question is very trivial. I need to implement some signal ...

12. out of memory    coderanch.com

I am processing very big files.. I get out of memory exception when I process every 1000 records in the file.. but processing 100 records is okay. but procesing every 100 records is using longer time than processing every 10 records.. I get two questions here. 1. how can I know the memory will be used out and can do some ...

13. How to Create file in Memory    coderanch.com

14. Avoid Memory allocation & dallocation    coderanch.com

I have an application which needs to read millions of xml data file through java IO & needs to extract characters( not java parser). ...... FileReader x_frd=new FileReader(file); BufferedReader br=new BufferedReader(x_frd); while((str=br.readLine())!=null) { ...... ........ } So, whenever i am reading a file, its allocating memory for FileReader,BufferedReader...& again deallocating memory.. Now my question is, Is there any way to avoid ...

15. create a file in memory ?    coderanch.com

Hi : I need to create a file, and store its contents in memory. Storing it as a byte[] in the jvm, however, is not an option because I need other programs to be able to access it. Is there a cross platform way of doing this ? If not I guess I will have to use unix sockets (are there ...

16. readObject() eat memory !!!    coderanch.com

Hello i have problem when i read object from file that generated from this code : import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.util.Hashtable; public class FreakSerialization { public static void main(String a[]) { try { ObjectOutputStream io = new ObjectOutputStream(new FileOutputStream("Hashtoblerone")); Hashtable hash = new Hashtable(); for(int i=0;i<1024000;i++) { hash.put(i,"1234567890"); } io.writeObject(hash); io.close(); } catch (FileNotFoundException e) ...





17. maximum size in memory file    coderanch.com

Hi guys : Two really important questions for an app that must be deployed soon, so please help ASAP... 1) What is the maximum size of a random access file in java ? Is it limited to the size of the JVM ? 2) Is there a way to allocate an unlimited amount of memory and heap space to the JVM, ...

18. Build a file in Memory    coderanch.com

An XML file is returned to me via a http connection. Currently I write the XML file out to a temporary file on the OS. After the file is completed I return the temporary filename which another uses to manipulate the XML file. Is it possible to build the file in memory and just return the file object? If so, can ...

19. use of listFiles() shoots up memory usage occasinally    coderanch.com

Hi, I have an application deployed in Unix env where a functionality is to search the File system for a specific file pattern. The drive is a SAN environment. Occasionally, on the listFiles() api call the thread hangs and it is observed that the heap size goes increasing till it reaches its max and the application throws OutOfMemory exception. This happens ...

20. Heap memory getting exhaust    coderanch.com

hi, In my application i need to uplaod a 3gb of file into db through hibernate. The flow of my application is read the file character by character and put into a collection object ,this collection object i am saving to DB through hibernate. The collection size is more than 1 lac of records. So please look into that and tell ...

21. String[] how much memory.    coderanch.com

Hi all. I want to know that if i use String[] a = new String[100], will it take any memory? If yes please tell me that how can i free it up. I also want to know that will it effect the performance if i use many times String[]. Thanks and regards alexander

22. Read/write values into java memory    coderanch.com

Strings are always stored in Java memory as a collection of two byte Unicode characters. You don't have any control over that. How you read or write Strings with streams depends what's on the other end of that stream. You could certainly read or write the Unicode characters without any conversion, but if you are talking to another program that doesn't ...

23. Memory contents as file    coderanch.com

Hello! I have contents in memory. Let's say I am storing the string "Hi There" as String str = "Hi There"; I have an executable program that reads contents from a file. I would like to take the contents from memory ("Hi There"), and have it read "from the filesystem" by the executable program, without having to actually write the contents ...

24. Memory management in Java application    coderanch.com

JVM has Garbage collectors that will execute when ever heap is short of memory. You cannot directly influence the JVM to run the garbage collectors. And you would have to carefully develop applications considering the platform. On a lower memory devices you will not have access to all the APIs (that which are in JavaSE) and also one would have to ...

25. Simple question about Memory Usage and File Size    forums.oracle.com

Hello all! I recently (5 minutes ago) joined SDN to ask this question, but now that I have an account I imagine I'll be active here. Please consider the following two snippits of code... Obviously they are two methods of doing the same thing. count += 1; and count = count + 1; I understand that maybe the advantage of the ...

26. Stream/Channel in memory; C# MemoryStream equivalent?    forums.oracle.com

Alright, I've tried to do my homework before posting this question, so bear with me. I'm coming from more of a C++ and C# background... I've only been pecking away at Java for 2-3 months. In C#, Stream is an abstract class inherited by MemoryStream, FileStream, and NetworkStream... maybe even some others, who knows. These Streams allow you to read/write data ...