memory

Is it slow on the iPhone to do a lot of mallocs and frees?

Hey guys, I was working on some particle systems and this was the only way I could figure out to set up the arrays: if (vertices){ free(vertices); } if (textures){ free(textures); } vertices = malloc(sizeof(point3D) * 4 * [particles count]); textures = malloc(sizeof(point2D) * 4 * [particles count]); The particles constantly ...

What is the most memory efficient way to write from a database to a (zip) file in Java?

My program is fast enough, but I'd rather give up that speed for memory optimization since one user's maximum memory usage goes up to 300 MB meaning few of them could constantly crash the application. Most of the answers I found were related to speed optimization, and other were just general ("if you write directly from a database to mem...

Does SWT's virtual tables release TableItems

In the context of displaying databases rows in an SWT VIRTUAL Table I am wondering if created TableItems are ever released by SWT in order for them to be garbage collected ? Using virtual table allows us not to load the full model into memory by asking on the fly data to the database each time SWT needs it (through the SWT.setData liste...

ListView Memory leak?

Hey I seem to be having some kind of memory leak issue with my listview. The list view activity is in a tab and each row downloads an image and displays it in an ImageView (tiling it as a backgroiund). I am using a cache similar to droidfu http://github.com/kaeppler/droid-fu/blob/master/src/main/java/com/github/droidfu/imageloader/ImageC...

Managing large sets of Images using Javascript on MobileSafari

I'm looking at ways to manage a large set of images within Mobile Safari for iPad. In this case I have a web app that will move the images using webkit CSS3 animations (supposedly taking advantage of hardware to do so). I've noticed that if I have more than 10 large images (200-300K each) I hit large performance issues. Animations are j...

How is memory compression achieved.?

How is memory compression achieved.? What is compcache..? How do I choose an appropriate technique for my system (its a telecom sw - running on SMP LINUX (from Windriver system)+Cavium Octeon processor)). There is just a physical memory of 2 GB with no swap. ...

What is the purpose of hard disk direct memory access?

At first glance it seems like a good idea to let the hard disk write to RAM on its own, without CPU instructions copying data, particularly with the success of asynchronous networking in mind. But the Wikipedia article on DMA states this: With DMA, the CPU gets freed from this overhead and can do useful tasks during data transfer (th...

CPU and Memory Cap for an AppDomain

I want to host an exe in an appdomain and assign a CPU and Memory cap to it so that it does not use more than the assigned processing power. Is this possible to do and how? ...

C data structure to disk

Hi, How can I make a copy of a tree data structure in memory to disk in C programming language? ...

Threaded code execution time rises slowly. How to determine the culprit?

I have some code in a thread. The code's main function is to call other methods, which write stuff to a SQL database like this: private void doWriteToDb() { while (true) { try { if (q.Count == 0) qFlag.WaitOne(); PFDbItem dbItem = null; lock (qL...

Why does creating a big Java array consume so much memory?

Why does the following line Object[] objects = new Object[10000000]; result in a lot of memory (~40M) being used by the JVM? Is there any way to know the internal working of the VM about arrays? Manu ...

C - How can I save structs to a malloc'd section of memory?

My question's pretty basic, but it's been a while. I'm reading in a text file and saving numbers in the text to a struct 'Record'. After I read text to my Record buffer, I want to place it in an area of memory. typedef struct { int line_status[64]; float line_data[64], relativetime; unsigned long blkhdr_ticks; } Record; Record *sto...

store run-time variables in C++

This is about a C++ problem. I have an object tracking program that takes images from 0,...,n in a loop. At current frame the computations are based on previous frames, therefore I need to hold those variables, matrices, etc for later use. This program has to be integrated now into another system which will provide an image and I have to...

Warning: require_once() [function.require-once]: Unable to allocate memory for pool. in /path/to/file

I've occasionally run up against a server's memory allocation limit, particularly with a bloated application like Wordpress, but never encountered "Unable to allocate memory for pool" and having trouble tracking down any information. Does anyone know what this means? Have tried increasing the memory_limit without success. Also haven't...

Does querying a database cost a lot of memory?

Hi there, I have this code which checks whether a file exists, and if it does it queries the sqlite database to make sure there is an entry. It is used in the method cellForRowAtIndexPath in a UITableViewController. Basically for each video that is listed in a Table I need to find if it EXISTS AND IS IN THE DATABASE. Will this cost a l...

Stack and heap in c sharp

Possible Duplicate: Why are structs stored on the stack while classes get stored on the heap(.NET)? Can anyone tell me that how the allocation of memory is done that which object is to be stored in stack and which to be in heap portion of the memory? ...

Free implementation of March memory testing algorithm

Dear Community For board bringup, me and my team is in search for a memory testing algorithm that will help us verify the design and test during production (bad soldering, cross-connected address/data lines, mismatched impedances, mirroring etc.). I've read that e.g. March C or similar is the answer to our prayers, but I haven't yet f...

Allocating a larger object in R?

I'm slightly confused on the following point: I am running R on 32-bit Windows. My understanding is that I should be able to allocate up to 2GB. I read though help("Memory") and launched my R session with the flag RGui.exe --max-mem-size=1000M. Then confirmed this within R: > memory.limit() [1] 1000 But when I run a particular op...

Assigning a const char[] do you need to put in a null term

We are setting a char [] to some hex values i.e. char [] test1 = {0x30,0x31,0x32,0x33,0x34,0x35}; Then we copy it into a string using string teststring(test1, sizeof(test1)); Is the array suppose to be null terminated? or is the way we do the assignment, C++ is smart enough to know that its null terminated and have it appended anyh...

Rails DB: How to cache complex calculations? Memoizing? Separate table? Action caching?

For my site, I have models Category and Product, with hundreds of categories, each having thousands of products. For the Category views, I'd like to do something like average price of all the products included. And for the product views, I'd like the average for that product's category to appear. So, with thousands of these calculations...