memory

How many times do I release an allocated or retained object?

Hi, I am making an iPhone game. I want to release all the object that have been allocated or retained. In the dealloc function I am releasing all such objects but then realized sometimes i end up releasing objects when they have not been allocated yet. So I figured I need to check if its retainCount is greater than zero or not before i ...

How to get the amount of free virtual memory on Apple / Mac?

How do I get the amount of free virtual memory on Mac OSX? I'm speaking of total free virtual memory (or: free addresses) and also the biggest allocatable continous block of memory available for the current process. (Like e.g. on Windows returned by GlobalMemoryStatus (free mem) or querieable with a combination of GetSystemInfo / Virt...

Memory consumption in Cherrypy

I am using Cherrypy in a RESTful web service and server returns XML as a result (lxml is being used to create XML). Some of those XMLs are quite large. I have noticed that memory is not being released after such request (that return large XML) has been processed. So, I have isolated a problem and created this one very short dummy examp...

C string literal storage between multiple copies of process or library

What is the behavior of various systems when you have more than one copy of a particular program or library running, do string literals get stored once in RAM or once for every copy of the process/library? What if they are stored in an array like: static const char *const foo[] = { "bar", "baz", "buz" }; Does the static change the beh...

Java App with lots of memory problems

Hi, I've written a pretty complex java application that is doing a lot of calculations on price data from the markets in real time and from looking at the task manager in windows this sucker is taking close to 1MEG every 30 seconds and the performance is fine until it gets closer to the memory limit around 300MEG and then the g-collecto...

jQuery fadein() memory leak?

Has anybody ever had any issues using fadeIn()? I'm working on a project right now and was having a lot of memory leaking, but when I changed all the instances of fadeIn() to css('display','block') it fixed it. ...

What's generally the size limit to switch from a vector to a deque?

I recent wrote this post: http://stackoverflow.com/questions/3737138/how-best-to-store-very-large-2d-list-of-floats-in-c-error-handling Some suggested that I implemented my 2D list-like structure of floats as a vector, others said a deque. From what I gather vector requires continuous memory, but is hence more efficient. Obviously thi...

How to copy memory from source thats not on byte alignment (shifted)

I can think of some nasty inefficient ways to accomplish this task, but I'm wondering what the best way is. For example I want to copy 10 bytes starting at the 3rd bit in a byte and copy to a pointer as usual. Is there a better way than to copy one shifted byte at a time? Thanks ...

Efficient memory storage and retrieval of categorized string literals in C++

Note: This is a follow up to this question. I have a "legacy" program which does hundreds of string matches against big chunks of HTML. For example if the HTML matches 1 of 20+ strings, do something. If it matches 1 of 4 other strings, do something else. There are 50-100 groups of these strings to match against these chunks of HTML (usu...

Help with memory problem on iOS/iPad

Hello - In my app, I have a bunch of different image packs to download. The images are downloaded from my website one by one. The packs contain anywhere from 100-1500 images and each image is about 100KB-200KB. When downloading the images, I have a method that selects the images to download, then I have a second method that does the act...

Can a Memcached daemon ever free() unused memory, without terminating the process?

I believe that you can't force a running Memcached instance to de-allocate memory, short of terminating that Memcached instance (and freeing all of the memory it held). Does anyone know of a definitive piece of documentation, or even a mailing list or blog posting from a reliable source, that can confirm or deny this impression? As I un...

looking for memory overruns hunting tool for C code that is called from Java

Hi, I'm looking for memory overruns hunting tools for C code that is called from Java via JNI. Usual tools for C like gdb, valgrind don't work. Thanks ...

How to read some data from a Windows application memory?

Hi, guys. I have an application, which displays me some data. I need to attach to this app's process, find the data I need in memory (one single number, actually), and save it somewhere. This application doesn't seem to use standard windows controls, so things aren't going to be as simple as reading controls data using AutoIt or somethi...

Multiple copies of data in datatable

How many copies of data does the datatable store ? I found this question from a year before but not a whole lot of details on there ? http://stackoverflow.com/questions/424598/what-is-the-memory-overhead-of-storing-data-in-a-net-datatable Spefically, when do the copies get created? Are they flushed only on .Save() / .Update() ? I have...

How can I read the bandwidth in use over the PCIe bus ?

I'm working on a streaming media application that pushes a lot of data to the graphics card at startup. The CPU is doing very little at the point when the data is being pushed, it idles along at close to zero percent usage. I'd like to monitor which machines struggle at pushing the initial data, and which ones can cope, in order that I...

GDB: how to see what memory addresses are accessible?

Suppose, in a debugging session I have an address which unfortunately points to some rubbish. And I want to examine memory around it to see what's located near. As expected, the following error occurs: (gdb) x/64 $t5 0x842da7ac: Cannot access memory at address 0x842da7ac So, the question is: is there any way to read a range of add...

java - How accurate is Runtime.maxMemory - is it OK to see difference of 9gig?

I start application with -Xmx100G. The value returned by Runtime.maxMemory is 91G. Where does the remaining memory (9G) go? I see from other posts that the API is not 100% accurate. I would like to know more about the difference. I set the virtual memory size by $ulimit -a 100000000. The command fails. $java -Xmx99g -version Erro...

C shared memory

I am trying to implement shared memory on embedded device with uClinux. My C source #include <stdio.h> #include <sys/shm.h> #include <sys/stat.h> #include <sys/socket.h> #include <errno.h> //using namespace std; int main() { int segment_id; segment_id = shmget(04, getpagesize(), IPC_CREAT | 0666); printf("Page...

Memory issue - Does Webkit cache CSS styles of elements?

Hi I am running into a memory issue with webkit browsers on Windows with my current project. I will first describe the project I work on, then describe the actual issue. Please take my apologies for the long text, I hope it's not too much.. I am working on a project that lets you view a printed magazine online. For iPad support it is d...

Page faults on OS X when reading with MMAP

I am trying to benchmark file system I/O on Mac OS X using mmap. #include <unistd.h> #include <fcntl.h> #include <dirent.h> #include <sys/stat.h> #include <sys/types.h> #include <sys/mman.h> #include <stdio.h> #include <math.h> char c; int main(int argc, char ** argv) { if (argc != 2) { printf("no files...