memory

Recommendations for a heap analysis tool for Java?

List your favorite heap analysis tools (e.g. jprofiler, jmap, ...). Let's keep it one tool per answer, with a short list of pros and cons for each tool. ...

How much memory does jProfiler need to analyze a heap dump of size X?

I have a heap size of X (= 5 giga bytes). How much should I allocate for jprofiler to efficiently analyze this heap? ...

Avoid memory fragmentation when allocating lots of arrays in Java

I am developing an application in Java that runs on Windows Mobile devices. In order to achieve this we have been using the Esmertec JBed JVM, which is not perfect but we are stuck with it for now. Recently we have been getting complaints from customers about OutOfMemoryErrors. After a lot of playing around with things I discovered th...

ASP.NET Memory Optimazation

Hi, getting: aspnet_wp.exe (PID: 988) was recycled because memory consumption exceeded the 148 MB (60 percent of available RAM). any suggestion of web.config etc optimization? did already all the debug/release compile stuff. but still it takes to fast to much memory. machine got 256mbs ram, on 512mb it runs smooth. want to squeeze ...

Memory analysis for a process

Hello guys I have a process which calls/creates another process, and this one will load a bunch of modules. The thing is that these modules will all be loaded in the same process as the caller (by default). Is there any way that I can collect resources information for the individual loaded module, even through they are all on one big p...

Why doesn't my threaded .Net app scale linearly when allocating large amounts of memory?

I’ve run into something strange about the effect of large memory allocations on the scalability of the .Net runtime. In my test application I create lots of strings in a tight loop for a fixed number of cycles and spit out a rate of loop iterations per second. The weirdness comes in when I run this loop in several threads – it appears th...

Call stack memory architecture

Following my question yesterday, I tried to learn a bit more about the architecture of call stacks. Online and SO searches have not yielded the answer I'm looking for, which could be because I don't know precisely which keywords to use. Anyway, I'm sure someone here can help me... First, lets start with an excerpt from Wikipedia's entry...

Freelists with concurrent allocators

Freelists are a common way to speed up allocation by reusing existing memory that was already allocated. Is there a way to use free-lists in a concurrent allocator, without incurring the overhead of a lock for every allocation (which would neutralize the intended performance gain of the freelist)? ...

android memory management outside heap

Hi I am working on an application for android and we since we have lots of graphics, we use a lot of memory. I monitor the memory heap size and its about 3-4 Mb , and peeks of 5Mb when I do something that requires more memory (and then goes back to 3). This is not a big deal, but some other stuff is handled outside the heap memory, li...

To show bitmap created in memory in Rave.

I have created a bitmap in memory, and would like to show this in rave report design time. I don't want to create a file then load. Is there a better way? Thanks and regards, jai ...

iPhone/iPodTouch. Regarding the flash drive. How much faster is it then a physical disk drive?

Does anyone have a ball park speed comparison between a modern physical disk drive and the flash drive on iPhone/iPodTouch? What is behind this question is this: I want to pull images from the cloud, park them on the flash drive and then sequence through them as a flipbook animation keeping as few images in RAM as possible so as to keep ...

Odd Memory Error -- Bad Alloc

Working on a WinPCap project. Trying to do some basic pointer and memory operations and having lots of errors. I've included the two lines I'm trying to run along with the includes. The same lines in another VSC++ project work just fine. This is the error I am getting Unhandled exception at 0x75a79617 in pktdump_ex.exe: Microsoft ...

Is there a language with RAII + Ref counting that does not have unsafe pointer arithmetric?

RAII = Resource Acuquisation is Initialitazation Ref Counting = "poor man's GC" Together, they are quite powerful (like a ref-counted 3D object holding a VBO, which it throws frees when it's destructor is called). Now, question is -- does RAII exist in any langauge besides C++? In particular, a language that does not allow pointer arit...

How to find all the structs that could be made smaller by changing the order of their members.

Background: The compiler may insert padding into a struct to make it's members align better. This will result in the sizeof the struct being larger than the sum of the sizes of it's members. Reordering the members of the structure so they pack better can remove the need for the compiler to pad in this manner and make the struct smaller s...

Finding memory allocation error

I'm getting memory allocation errors (and a subsequent crash) on the following simplified code: std::wstring myKey = L"str_not_actually_constant"; MyType obj; Read( obj ); std::map<std::wstring, MyType> myMap; myMap[myKey] = obj; // Sometimes allocation error (1) ... Read( MyType& obj ) { obj.member1 = ReadFromFuncThatMayBeProblem()...

JavaScript objects: Destroying them

I have to maintain a JavaScript object with some 30-40 properties, which I update every few seconds. I have read that there is no such thing as "freeing" memory in JavaScript, and the browser automatically garbage collects unused memory. My question is: is it enough to set the object itself to null, or do I need to set all its propertie...

NSMutableArray initWithContentsOfFile memory leak

I´m new in iPhone development and I have this memory leak. I´m using an NSMutableArray to retreive the content of a .plist file located in the Documents directory. The first time I use it, everything goes fine, but if I call it several times I get a memory leak. This is my code: - (void)viewWillAppear:(BOOL)animated { [super viewWi...

Java unrequested memory allocation

The following piece of code observed under JConsole shows a constant increase of the heap size. The heap reach a maximum of 25mb and then the GC runs and decease the heap size to almost 3MB. Is this the expected behavior ? I'm very surprised! public class Dummy { public static void main(String[] args) { System.out.println("...

Memory usage limits for programs on Windows (7)

I strongly expect this to end up as a duplication, but I can't seem to find it. I've got a C++ program that I normally run on 64-bit MacOSX SnowLeopard. When I try to run it on a 32-bit Windows 7, it runs out of memory. Probably, it really needs too much memory, but I want to make sure that I'm not missing some sort of option or anoth...

Very Compact Bitarray in Java

I'm looking for a very compact way of storing a dense variable length bitarray in Java. Right now, I'm using BitSet, but it seems to use on average 1.5*n bits of storage space for a bit vector of size n. Typically, this isn't a problem, but in this case the bitarrays being stored are a pretty significant part the memory footprint of the ...