memory-management

Does ADO.NET + massive INSERTs + Excel + C# = "A bad time"?

Basically I need to insert a bunch of data to an Excel file. Creating an OleDB connection appears to be the fastest way but I've seen to have run into memory issues. The memory used by the process seems to keep growing as I execute INSERT queries. I've narrowed them down to only happen when I output to the Excel file (the memory holds...

.NET CF Application and Out of Memory Exception

Hi, I am developing a .NET CF 3.5 network game. My issue is the app loads all the resources at first instance. However upon subsequent launches, the app gives me memory out of exception while loading resources especially sounds or big images. Please guide me ...

In CocoaTouch (iPhone OS) how do I find/eliminate leaks that the Instruments Leak tool doesn't find?

I have an iPhone app that is running great in the simulator. It responds well to the memory warnings by getting rid of everything that is not absolutely essential. When I run it on the device, it runs well. But after a certain amount of usage it crashes with error code 101 - which, from what I can tell, is the OS killing it due to mem...

Garbage Collector Flash Player

Is there a way to force the flash garbage collector to clean up freed memory? I've seen that it takes a lot of time for flash to clean up not referenced memory... ...

Time complexity of memory allocation

What is the time complexity of dynamic memory allocation using new, malloc, etc.? I know very little about how memory allocators are implemented, but I assume the answer is that it depends on the implementation. Therefore, please answer for some of the more common cases/implementations. Edit: I vaguely remember hearing that heap allo...

Freeing alloca-allocated memory

Is it possible to free memory allocated by C's alloca() explicitly, before the current function exits? If so,how? ...

function returns and dynamic memory question

I have a dll that must be useable from C etc, so I cant use string objects etc as a normal would, but I'm not sure on how to do this safely.. const char *GetString() { std::stringstream ss; ss << "The random number is: " << rand(); return ss.str().c_str(); } could the c string be destroyed when ss falls off the stack? I'm ...

The Big Tree: When to Release Data in an RIA

This question is about a Java JTree or a Window .Net Tree (Winforms) or an Adobe Flex Tree. In a client-server application (for Flex it's Web, really), I have a tree with hierarchical data (in a Windows Explorer type interface). Right now I lazily load up the tree as the user requests more data from the server. This is fine and will wor...

Problem dealloc'ing memory used by UIImageViews with fairly large image in an UIScrollView

I have a large UIScrollView into which I'm placing 3-4 rather large (320x1500 pixels or so) UIImageView image tiles. I'm adding these UIImageViews to the scroll view inside of my NIB files. I have one outlet on my controller, and that is to the UIScrollView. I'm using a property (nonatomic, retain) for this, and sythesizing it. My qu...

What constitutes a good memory profile?

In designing any desktop applications, are there any general rules on how much memory should the application uses? For heavy-weight applications, those can be easily understood or at least profiled such as Firefox or Google Chrome. But for smaller utilities or line-of-business application, how much is an acceptable amount of memory usag...

Requesting memory for your application

I am having a similar issue to this person. The primary difference being the application is NOT meant for a developer environment, and therefore I need to know how to optimize the space used by Sql Server (possibly per machine based on specs). I was intrigued by Ricardo C's answer, particularly the following: Extracted fromt he SQL...

Virtual area to pages

In the Linux kernel, given the task_struct's mm I can access the process's list of vm_area_structs. Given these vm_area_structs, how do I get the struct pages which actually correspond to this vma? I tried looking for functions in mm/memory.c and the like, but I was at a loss. Edit: the idea is to find which pages in the vma are curre...

Most efficient way to append arrays in C#?

Hi, I am pulling data out of an old-school ActiveX in the form of arrays of doubles. I don't initially know the final number of samples I will actually retrieve. What is the most efficient way to concatenate these arrays together in C# as I pull them out of the system? ...

FreeMM vs ShareMem

Hi, We have a lot of dll-libraries written in both delphi and c++ builder, and use sharemem and borlndmm.dll. An aligment-issue in a 3thparty library forces us over to the new memorymanager in delphi 2007. Can someone please explain 'shared memory manager' for me? Is SimpleShareMem a dropin replacement for ShareMem ? Can we then stop ...

C++: Do static primitives become invalid at program exit?

Assume I have a function like this: MyClass &MyFunction(void) { static MyClass *ptr = 0; if (ptr == 0) ptr = new MyClass; return MyClass; } The question is at program exit time, will the ptr variable ever become invalid (i.e. the contents of that ptr are cleaned up by the exiting process)? I realize that this function leaks,...

What's the Best Way to Measure Memory Use from a Program?

I've been trying to optimize the Windows program I am developing, trying to find the best data structures that will minimize memory use. It loads large blocks of data, so with huge files, it can use a large amount of RAM. For memory measurement, I have been using GlobalMemoryStatusEx. See: http://msdn.microsoft.com/en-us/library/aa36658...

string interning memory

where is a good resource on string interning . . how do i know if my app is a good candidate for string interning to help with memory footprint? ...

Updating from Java VM 5 to 6 gave a really big increase of memory consumption

Hi, I've be working with a Java application run through the command-line. It deals with XML files, specially the dblp.xml database which has more than 400MB. I was using JVM 5 and my app needed sort of 600-700MB of memory to processe the dblp.xml. After updating to JVM 6, it starting needing more than 1gb of memory (something I don't h...

Find out the size of a .net object

I'm trying to find out how much memory my objects take to see how many of them are ending up on the Large Object Heap (which is anything over 85,000 bytes). Is it as simple as adding 4 for an int, 8 for a long, 4 (or 8 if you're on 64 bit) for any reference types etc for each object, or are there overheads for methods, properties etc. ...

Java still uses system memory after deallocation of objects and garbage collection.

I am running JVM 1.5.0 (Mac OS X Default), and I am monitoring my Java program in the Activity Monitor. I have the following: import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Date; public class MemoryTest { public static void memoryUsage() { Sys...