memory

Deleting C++ pointers to an object

I thought that the delete command would free up memory I allocated. Can someone explain why it seems I still have the memory in use after delete? class Test { public: int time; }; int main() { Test *e; e = new Test; e->time = 1; cout << e->time << endl; delete e; e->time = 2; cout << e->time << endl;...

Get Device Memory Xcode

Hi, I really need to know of a way to get the current users device: 1. Active Memory 2. Inactive Memory 3. Wired Memory 4. Free Memory 5. Total Memory. Any information, code or anything is helpful. Thanks In Advance. ...

Read a tiff file's dimension and resolution without loading it first

How to read a tiff file's dimension (width and height) and resolution (horizontal and vertical) without first loading it into memory by using code like the following. It is too slow for big files and I don't need to manipulate them. Image tif = Image.FromFile(@"C:\large_size.tif"); float width = tif.PhysicalDimension.Width; float heigh...

C Shared memory database

So this is a homework assignment, and it's kind of a doozy so i'll try to TL;DR it. Basically Im making a Shared memory database with 5 files (load,query,clean,print,change) Load loads the database from a file. (students have a first name/last name/address/telephone number) Query lets someone "search" for a specific student print....well...

how can i 'flush' my cURL session's memory without opening a new session?

I am writing a scraper in PHP using cURL but am experiencing some memory issues. These memory issues arise since i am using a single cURL session to log in to a website, and then to scrape many pages. Is there a way to 'flush' the cURL session's memory without having to close the session, open another one and re-log in? Perhaps I coul...

Generally speaking, do I write code that saves memory or code to save processing time for simple objects for smartphone applications?

I’m not sure this is the best example, but here goes. Let’s say I want to draw an object to a canvas in an Android application. I need to do some math and call a method to return screen size to figure out where to draw it since my app should support multiple screens. I really only need to do this procedure once, as every time I want t...

Manipulating pointers using C

Hi, While working with pointers in C, I have been experiencing a very incosistent result, I am working with a token which is a byte string which i need to make a directory path. a token consists of the date as a prefix in the format of 20101129(2010-oct-29) and then a 20byte string follows, thus a token would look like 20101102A2D8B328CX...

Load shared memory in C

So Im making a Load.c file, that basically will load a bunch of "students" into shared memory. The students are stored in a struct that looks like this: struct StudentInfo{ char fName[20]; char lName[20]; char telNumber[15]; char whoModified[10]; }; Anyways I need to load this in shared memory, we were given some sample code. and we a...

Trashed properties in Application Delegate.

I'm in deep trouble. Something in my app causes a lot of properties in my app delegate to become trashed (changing contents and even object type, say an NSArray becomes an NSString...), and I can't debug it out. I can find no memory leaks or errors on my part. The only thing I've found is that all the way to ViewDidAppear for the view of...

iOS Core Data how can it leak?

Hello I was analyzing my app with leaks, and i observe that some core data entity is leaking, how can a NSManagedObject leak? I thought it was managed by the operating system? Are there known leaks in core data? The line that Leaks says causes the leak is NSMutableArray *e=[NSMutableArray arrayWithArray:[[user videos] allObjects]]; ...

Trying to make an array of DirectX vertex with out knowing until run time what type they will be

Bit of background for those who don't know DirectX. A vertex is not just an XYZ position, it can have other data in it as well. DirectX uses a system known as Flexible Vertex Format, FVF, to let you define what format you want your vertexs to be in. You define these by passing a number to DirectX that use bitwise or to build it up, eg (D...

Memory Segments of a Program in C

I'm looking for a tutorial describing about the various memory segments of a C program like code segment, data segment etc and what type of information is stored into them (i.e. where global, static, automatic etc variables are stored and why?). --Ravi ...

Does prstat SIZE value in Solaris increase indicate memory leak?

In my program, I create 100 threads, then wait for all of them to join and then repeat this operation again. In each of the threads, I create some memory and free it. I am fairly sure, all the memory which I am creating in those threads are getting freed. But, the SIZE output and RSS output of prstat are continously increasing. They ar...

What is a contiguous memory block?

Just like in the title, what is a contiguous memory block? ...

How do I make my dependencies call my global operator new?

Hi, I have a test app that is linked with some DLLs (or .so's). In my main app I defined a global new/delete like this: void* operator new(size_t n) { .... } void operator delete(void* p) { ... } But I noticed the operators are only called for things I allocate in my main app, but not if one of the DLLs does. How do I make ...

A simple program to demonstrate memory leak in Java

I am looking for a simple program that can demonstrate memory leak in Java. Thanks. ...

String Compare problems? C

Ok so im having a bit of an issue here. basically Im reading shared memory but thats not the problem. I have a change.c function that lets me change a struct studentdata shared memory if I enter their "ID" number. ISSUE WAS SOLVED ...

Why is this javascript code making browser draw 50% CPU and so much memory?

I have this banner rotator code: function ban_rot() { //First preload images // counter var i = 0; // create object imageObj = new Image(); // set image list images = new Array(); images[0] = "../Graphics/adv/1.gif" images[1] = "../Graphics/adv/2.jpg" // start preloading for (i = 0; i <= im...