memory-usage

Does a CPU assigns a value atomically to memory?

Hi! A quick question I've been wondering about for some time; Does the CPU assign values atomically, or, is it bit by bit (say for example a 32bit integer). If it's bit by bit, could another thread accessing this exact location get a "part" of the to-be-assigned value? Think of this: I have two threads and one shared "unsigned int" var...

What is the default maximum heap size for Sun's JVM from J2SE 6?

What is the default maximum heap size for Sun's JVM from J2SE 6 (i.e. equivalent to setting -Xmx)? Looks like for J2SE 5 with a server-class machine, it's Smaller of 1/4th of the physical memory or 1GB. Bonus question: Looks like for IBM's JVM you can ask it java -verbose:sizes -version Can you similarly ask Sun's JVM? Edit: ...

The best alternative for String flyweight implementation in Java

My application is multithreaded with intensive String processing. We are experiencing excessive memory consumption and profiling has demonstrated that this is due to String data. I think that memory consumption would benefit greatly from using some kind of flyweight pattern implementation or even cache (I know for sure that Strings are o...

Memory Troubles with UIImagePicker

I'm building an app that has several different sections to it, all of which are pretty image-heavy. It ties in with my client's website and they're a "high-design" type outfit. One piece of the app is images uploaded from the camera or the library, and a tableview that shows a grid of thumbnails. Pretty reliably, when I'm dealing with t...

Java / Tomcat memory leak in RedHat Linux?

Hi, I've got a Red Hat box with 6G memory running Tomcat and I'm trying to figure out how much memory I have left on the box. Problem is, top & jconsole is showing one figure (around 200M), and system monitor is showing a different figure (around 2G). Does anybody know what the difference is? I'm not sure if there is a memory leak happ...

System Tray Application and Memory Footprint

Hello everyone, I have created a small application that, basically, exists in the system tray and the user only needs to open the actual application in VERY few cases. The problem is, that once the suer opened the application for the first time, the memory is filled up with an awful lot of data (WPF UI for datagrids, treeviews etc). But...

Memory Profiling: How to detect which application/package is consuming too much memory

Hi, I have a situation here at work where we run a JEE server with several applications deployed on it. Lately, we've been having frequent OutOfMemoryException's. We suspect some of the apps might be behaving badly, maybe leaking, or something. The problem is, we can't really tell which one. We have run some memory profilers (like Your...

Measuring memory usage in .Net

I'm trying to get a program I'm writing (in F#, though I would imagine the answer here is the same for any CLR language?) to report on its own memory usage (so I can get an idea of how much I'm stressing the machine, compare sizes of different workloads, and evaluate the effect of any optimizations I do in the hope of saving memory). Th...

C++: How do applications like Cheat Engine and ArtMoney work?

After asking this question (C++: Can I get out of the bounds of my app’s memory with a pointer?), I decided to accept it isn't possible to modify other app's memory with pointers (with a modern OS). But if this isn't possible, how do programs like ArtMoney and CheatEngine work? Thanks ...

Monitoring application to monitor a Java desktop application performance

Hey, I have a Java desktop application I wrote, and I would like a recommendation about a monitoring application that can spot bottlenecks in the code and real time memory consumptions. As I was developing for J2Me, the WTK then, had a memory monitor, and I found it really useful, I would like to know which monitoring program you think...

Java memory usage increases when App is used, but doesnt decrease when not being used.

I have a java application that uses a lot of memory when used, but when the program is not being used, the memory usage doesnt go down. Is there a way to force Java to release this memory? Because this memory is not needed at that time, I can understand to reserve a small amount of memory, but Java just reserves all the memory it ever u...

Does class without data member have memory footprint in java ?

My question is related to memory footprint in java for class without data member. Suppose in java I have a class which doesn't have data member and it only contains methods. So if I am creating instance of particular class then does it occupies memory in primary memory except object reference memory ? ...

Reactive Extensions memory usage

I have the following code in a WPF application using Reactive Extensions for .NET: public MainWindow() { InitializeComponent(); var leftButtonDown = Observable.FromEvent<MouseButtonEventArgs>(this, "MouseLeftButtonDown"); var leftButtonUp = Observable.FromEvent<MouseButtonEventArgs>(this, "MouseLeftButtonUp"); var move...

Display Image from Byte Array in WPF - Memory Issues

Hi, I've developed an application to capture and save images to a database, but I'm having an issue with memory usage. On my domain object I have 3 properties: Image - Byte array, contents are a jpg RealImageThumb - The byte array converted to a BitmapImage and shrunk, displayed to the user in a gridview with other thumbnails Real...

What is the best way to find a process's memory allocations in terms of C# objects

I have written various C# console based applications, some of them long running some not, which can over time have a large memory foot print. When looking at the windows perofrmance monitor via the task manager, the same question keeps cropping up in my mind; how do I get a break down of the number objects by type that are contributing t...

Drupal 5.x site shows > 550 MB memory consumption of every page. How to speed up Drupal 5.x site.

I developed a site in Drupal 5.x and now its done and working fine, but its very slow. Working fast some time, but for imp modules it takes time. When I see the performance logs, its consuming my memory for 150 MB per page MINIMUM. This is the minimum. Most of the pages its shows 550~700 MB consumption. What I did till now. Javascr...

Python memory usage: Which of my objects is hogging the most memory?

The program I've written stores a large amount of data in dictionaries. Specifically, I'm creating 1588 instances of a class, each of which contains 15 dictionaries with 1500 float to float mappings. This process has been using up the 2GB of memory on my laptop pretty quickly (I start writing to swap at about the 1000th instance of the c...

Is there any function method to call to check memory consumption on iPhone

Instead of using instrumentation, is there a way to get current consumption? I want to periodically log the memory consumption (or how much free memory I got). ...

In C#, what is the smallest memory footprint way of storing database rows in memory for processing?

I am somewhat new to C# programming and need some advice on how to tackle a problem. I need to process tens of thousands records stored on a SQL Server database, and the processing should be as fast as possible. To maximize the performance, I am fetching the rows from the database on a background thread when the application starts, beca...

Is there a way to free only a part of the dynamically allocated array in C\C++ (shrink existing array)?

In a program I allocate a huge multidimensional array, do some number-crunching, then only the first part of that array is of further interest and I'd like to free just a part of the array and continue to work with the data in the first part. I tried using realloc, but I am not sure whether this is the correct way, given I must preserve ...