memory

Should a g_object_new have a matching g_object_unref?

I'm using libnotify to show desktop notifications in my application; notify_notification_new() returns a NotifyNotification*, which should be passed as the first param to further function calls of the notification library. There is no notify_notification_free() which frees the pointer it returns. I looked up the source of notify_notifi...

why does this code leak? (iphone)

This is the header: @interface ForumBrowserAppDelegate : NSObject <UIApplicationDelegate> { ForumSelection *forumSelection; UIWindow *window; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet ForumSelection *forumSelection; (I'm not sure what the nonatomic does, is it something to do w...

Null reference for first memory address between 0 - 65535

I would like to understand a bit more about memory and I was unable to find it from Google, please forgive me if this is silly question. How come the following code, accessing memory address 0(and up to 65535) in C# would throw NullReferenceException byte* pointer = (byte*)0; byte test = *pointer; Thanks a lot in advance! ...

Can't get past 2542 Threads in Java on 4GB iMac OSX 10.6.3 Snow Leopard (32bit)

I am running the following program trying to figure out how to configure my JVM to get the maximum number of threads my machine can support. For those that might not know, Snow Leopard ships with Java 6. I tried starting it with defaults, and the following command lines, I always get the Out of Memory Error at Thread 2542 no matter what...

How do I handle memory warnings when generating UIImages from PDF files in Objective-C?

When converting PDF Pages into UIImages I receive memory warnings all the time. It seems there is either some leak or something else that eats my memory. Using instruments didn't give me any helpful details. I'm using the following function to generate images from a pdf file: - (UIImage*)pdfImage:(NSString*)pdfFilename page:(int)page...

How to get rid Memory Leak problem "open_handle_to_dylib_path"

Hi Friends, I am getting a memory leak of 128 bytes, in my iPhone App and the responsible caller mentioned in Instruments was "open_handle_to_dylib_path" and the responsible library is "CoreGraphics". So has anybody encountered this problem ? Thanks and regards, krishnan. ...

Low memory with 640Kb of live bytes?

Hello, i've a problem with my application that need to display a lot of images and video. After running ObjectAlloc tool, i see that the live bytes is 640Kb and the overall memory is 31,54Mb when the application crash. In the organizer i get a "low memory" report so i guess the app crashed because low memory but the ObjectAllocation d...

Who deletes the copied instance in + operator ? (c++)

Hello, I searched how to implement + operator properly all over the internet and all the results i found do the following steps : const MyClass MyClass::operator+(const MyClass &other) const { MyClass result = *this; // Make a copy of myself. Same as MyClass result(*this); result += other; // Use += to add other to t...

iPhone real memory climbs when interacting with UI

I've been using the Activity Monitor to check the memory usage of my iPhone apps. I've noticed that the Real Memory climbs whenever I interact with the UI in any way, even if there's no code being called. For example, I can create a brand new View-Based application and run it, and as I click or drag in the empty window the Real Memor...

How to release the VM / private bytes of a Desktop application in c#

Hi, I have desktop application developed in C#. The VM Size used by application is very high. I want to add watermark to a pdf file, which has more that 10,000 pages, 10776 pages to be exact, the VM size inscreases and some times the application freezes or it throws out of memory exception. Is there a solution to release / decrease the...

Get browser memory usage on windows shell

Hi, is there a way to find the memory usage of a browser in execution with windows shell? I don't know if it's a stupid question or not because i'm not practice with shell so please be patient:) ...

Is valgrind crazy or is this is a genuine std map iterator memory leak?

Well, I'm very new to Valgrind and memory leak profilers in general. And I must say it is a bit scary when you start using them cause you can't stop wondering how many leaks you might have left unsolved before! To the point, as I'm not an experienced in c++ programmer, I would like to check if this is certainly a memory leak or is it th...

Should this C pointer be released?

Please excuse my C newbiness. Consider the following C procedure: int doSomething() { char *numbers="123456"; ... } Before this procedure exits should I be releasing the 'numbers' pointer? ...

My iphone app gets memory warning and killed at 6.8MB

My app has a thread that does some time consuming job for more than a minute and the app consumes around 6.8MB of memory. I receive a memory warning after sometime and then it gets killed. There is nothing that I can release, and I am using not even 7MB of memory...driving me crazy...any advice please? ...

Very large database, very small portion most being retrieved in real time

Hi folks, I have an interesting database problem. I have a DB that is 150GB in size. My memory buffer is 8GB. Most of my data is rarely being retrieved, or mainly being retrieved by backend processes. I would very much prefer to keep them around because some features require them. Some of it (namely some tables, and some identifiable ...

Objective C memory leaking

Hi everyone, I'm creating one Cocoa application for myself and I found a problem. I have two NSTextFields and they're connected to each other as nextKeyViews. When I run this app with memory leaks detection tool and tab through those 2 textboxes for a while, enter some text etc., I start to leak memory. It shows me that the AppKit librar...

Cuda program results are always zero in HW, correct in EMU??

Hi all! I am having a weird problem .. I have written a CUDA code which executes correctly in emulation and all results show up.. however, when executed on hardware "G210" .. the results in the result memory are always 0 I am passing two vectors to the kernel, one with random variables the other is initialized to zero, the code copies ...

IE doesnot clear Flash Object from memory

Hi, I have dynamically added a Flex Object in a HTML page through JavaScript. The Flex object is located in a "div" tag. Now when I call the "removeChild" JavScript function to remove the dynamically added "Object" tag, the object tag gets removed succesfully; however the memory that has increased due to the loading of the Flex Object is...

Keeping object in memory (iPhone SDK)

I am trying to create a UIImageView called theImageView in the touchesBegan method that I can then then move to a new location in touchesMoved. Currently I am receiving an "undeclared" error in touchesMoved where I set the new location for theImageView. What can I do to keep theImageView in memory between these two methods? EDIT: I am ...

HeapCreate, HeapAlloc in Linux, private allocator for Linux

Hi, In Windows, for very demanding applications, a programmer may use HeapCreate, HeapAlloc in order to better manage and control the allocation of memory- speed it up (aka private allocators). What is the equivalent in Linux c++ programming? ...