I'm trying to create a program which takes in a set number of strings (the user is asked to put in the number of strings they will enter), once it has these strings, they are placed in an array, using dynamic memory.
The ouput would be something like this:
# of Strings: 3
Cat
Dog
Elephant
Cat
Dog
Elephant
Heres a snippet of my code...
Hi,
I got this err msg in NetBeans 6.8 :
Exception in thread "main" java.sql.SQLException: out of memory
at org.sqlite.DB.throwex(DB.java:288)
at org.sqlite.NativeDB._open(Native Method)
at org.sqlite.DB.open(DB.java:77)
at org.sqlite.Conn.<init>(Conn.java:88)
at org.sqlite.JDBC.connect(JDBC.java:...
I created a singleton registry to contain instances of all my objects, and I try to unset variables when they are no longer in use. However, I can't seem to ever find all of the variables in use. There always seems to be a couple hundred KB that I can't explain floating around...
I'm not sure it this is possible, but can you access an i...
I'm making a Java application that uses the Slick library to load images. However, on some computers, I get this error when trying to run the program:
Exception in thread "main" java.lang.OutOfMemoryError
at sun.misc.Unsafe.allocateMemory(Native Method)
at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:99)
at java...
I have noticed in my application that didReceiveMemoryWarning gets called much faster if my phone has not been powered down for a long time. It almost seems like the pool of memory that my application can access shrinks with time.
Has anyone else noticed this and is there an explanation for it? Is there a course of action that I can tak...
Which interpreted languages pointer-free languages (IE: Python, Java, Perl, PHP, Ruby, Javascript, etc) have manual memory management? I don't recall ever hearing of one.
Isn't the major concern about interpreted languages the non-deterministic delays (or space complexity when there isn't enough delay) of garbage collection? So why not ...
I have an array of objects (say, images), which is too large to fit into memory (e.g. 40GB). But my code needs to be able to randomly access these objects at runtime.
What is the best way to do this?
From my code's point of view, it shouldn't matter, of course, if some of the data is on disk or temporarily stored in memory; it should ...
I've noticed the following behavior.
I have a file that is about 3MB containing several thousand rows.
In the rows I split and create prepared statement (about 250 000 statements).
What I do is:
preparedStatement
addBatch
do for every 200 rows {
executeBatch
clearBatch().
}
at the end
commit()
The memory usage will increase to ...
I'm a newbie and need some help with an iPhone App running on the Simulator. The app works fine running with Build & Run or Build & Run - breakpoints off, but blows when running with Build & Debug - Breakpoints on. Any help or thoughts would be greatly appreciated. Lon
Specifics: No breakpoints set, never gets to any visible simulator ...
Hello. I want to make simple functions that given an offset (and knowing the base address of a library) can retrieve or set the value located in there.
Questions:
What are the pratical differences between types of memory?
What I want to know exactly is: with what do I have to be concerned with, to make it work transparently. For examp...
I have the following code runs over a large set of data (2M). It eats up all my 4G mem before finishing.
for sample in session.query(CodeSample).yield_per(100):
for proj in projects:
if sample.filename.startswith(proj.abs_source):
sample.filename = "some other path"
...
I used a variable with a lot of data in it, say String data.
I wanted to use a small part of this string in the following way:
this.smallpart = data.substring(12,18);
After some hours of debugging (with a memory visualizer) I found out that the objects field smallpart remembered all the data from data, although it only contained the s...
I have a file from which I read data.
All the text from this file is stored in a String variable (a very big variable).
Then in another part of my app I want to walk through this string and extract useful information, step-by-step (parsing the string).
In the meanwhile my memory gets full and an OutOfMemory exception keeps me from furth...
I'm using a block processing approach to handle a calculation between two large matrices.
The code significantly speeds up when using a larger block size. But if I go too large, then I get an Out of Memory error. Currently I hand-tune my code to find the largest working block size for a given input.
My question: how can I automate ...
This is a little bit of a weird one, and my first foray into the world of .net so I'm hoping that I'm missing something fundamental :) Background:
I have a native/Qt c++ DLL that I am wrapping for use in .NET, C# in this case. I have a Qt app that uses this DLL successfully, without memory leaks, etc. I have created a c++/CLI wrapper...
Hi all.
I have a function in C++ that I call with its memory address with typedef, and I want to do the same thing in Delphi.
typedef void (*function_t)(char *format, ...);
function_t Function;
Function = (function_t)0x00477123;
And then, I call it with: Function("string", etc);
I tried to do this in Delphi, but got no results.
I...
I'm consistently receiving a memory warning right after pressing the "Use" button on the UIImagePickerController in Camera mode.
I used Instruments for the first time to try to figure out what's going on, but I don't see a problem. Before opening the image picker controller, my app is using ~2.0 MB of memory. It looks like both Camera ...
I am working on a c parser and wondering how expert manage large amount of text / string (> 100mb) to store in memory?
the content is expected to be accessible all the time in fast pace.
bg: redhat / gcc / libc
a single char array would be out of boundary causing segmentation fault...
any idea or experience is welcomed to share / dis...
I would like to know if there is for linux a way of retrieving the protection of the memory. Like, I want to restore the protection that existed after changing it with mprotect.
...
Recently I've time off of school for a few days and wanted to do a small program(s) experiment in c++ dealing with memory address.
I wanted to see is that if a currently running program (Let call it Program A) that created a pointer to an int object in the heap, can be seen by another program and be modified (Program B).
So for Progr...