memory-usage

Troubleshooting ERROR_NOT_ENOUGH_MEMORY

Our application is failing on one specific user's computer with ERROR_NOT_ENOUGH_MEMORY ("Not enough storage is available to process this command"). The error is apparently being raised somewhere deep within the Delphi VCL framework that we're using, so I'm not sure which Windows API function is responsible. Is memory a problem? A cal...

Spring ApplicationContext taking up grotesque amounts of memory

Hello, I have numerous Spring Framework-based applications that run on a Tomcat 5.5 server. Some of them have their own instances, some share a server with other applications. The one thing they all have in common is that they require huge amounts of memory, more than I think they should really require. Are there any tools out there ...

cooperative memory usage across threads?

I have an application that has multiple threads processing work from a todo queue. I have no influence over what gets into the queue and in what order (it is fed externally by the user). A single work item from the queue may take anywhere between a couple of seconds to several hours of runtime and should not be interrupted while processi...

The right way to manage a big matrix in Java

I'm working with a big matrix (not sparse), it contains about 10^10 double. Of course I cannot keep it in memory, and I need just 1 row at time. I thought to split it in files, every file 1 row (it requires a lot of files) and just read a file every time I need a row. do you know any more efficient way? ...

Do static members help memory efficiency?

If I have a class that I expect to be used in thousands of instances in a memory-sensitive application, does it help if I factor out static functionality to static members? I imagine that static methods and variables are stored once per class while for non-static members there has to be something stored for each instance. With member v...

Is there an equivalent of -applicationDidReceiveMemoryWarning: on the Mac

I'm looking for an equivalent to the -(void)applicationDidReceiveMemoryWarning:(UIApplication *)application method that's available on the iPhone. So far I haven't been able to find anything, but I'd like to check before I start writing my own. ...

iPhone dev - why is it using 8MB ?

Even when I just use the Window-based application template, which does literally nothing, instruments (activity monitor) says my application's process is using 8.14MB of Real Memory! Even with this method: void report_memory(void) { struct task_basic_info info; mach_msg_type_number_t size = sizeof(info); kern_return_t kerr =...

Estimate/Calculate Session Memory Usage

I would like to estimate the amount of memory used by each session on my server in my ASP.NET web application. A few key questions: How much memory is allocated just to have each Session instance? Is the memory usage of each variable equal to its given address space (e.g. 32 bits for an Int32)? What about variables with variable addres...

Page File Usage

I run a script which does text manipulation on the files system. The script runs on text files ( .h, .cpp ). As the script runs i see that the PF usage increases up until it reaches the amount of VM allocated for the page file. Is there a way to flush the VM during the run or after it? I have opend another question regarding it ( tho...

Memory overhead of Java HashMap compared to ArrayList

I am wondering what is the memory overhead of java HashMap compared to ArrayList? Update: I would like to improve the speed for searching for specific values of a big pack (6 Millions+) of identical objects. Thus, I am thinking about using one or several HashMap instead of using ArrayList. But I am wondering what is the overhead of Ha...

Incrementally building a numpy array and measuring memory usage

I have a series of large text files (up to 1 gig) that are output from an experiment that need to be analysed in Python. They would be best loaded into a 2D numpy array, which presents the first question: As the number of rows is unknown at the beginning of the loading, how can a very large numpy array be most efficiently built, row by...

String capitalize - better way

What method of capitalizing is better? mine: char[] charArray = string.toCharArray(); charArray[0] = Character.toUpperCase(charArray[0]); return new String(charArray); or commons lang - StringUtils.capitalize: return new StringBuffer(strLen) .append(Character.toTitleCase(str.charAt(0))) .append(str.substring(...

Java: Unsigned numbers

Hello, Is there a way in Java to use Unsigned numbers like in (My)SQL? For example: I want to use an 8-bit variable (byte) with a range like: 0 -> 256; instead of -128 -> 127. ...

how can I get total physical memory in C#?

hi all I using GlobalMemoryStatusEx function to retrieves information about memory, but this function don't work correctly, it return 0 for all properies. I have windows 7, I think this function don't work in WIN 7. [StructLayout(LayoutKind.Sequential)] internal struct MEMORYSTATUSEX { internal uint dwLength; ...

How to reduce Netbeans' memory usage?

When using netbeans to edit a PHP project, the IDE can (over time) use 400+ MB of memory. Is there any way to turn off certain features or other tricks to reduce its memory usage? ...

Memory usage of current process in C

I need to get the memory usage of the current process in C. Can someone offer a code sample of how to do this on a Linux platform? I'm aware of the cat /proc/<your pid>/status method of getting memory usage, but I have no idea how to capture that in C. BTW, it's for a PHP extension I'm modifying (granted, I'm a C newbie). If there are ...

How to display iPhone free memory ? and how to free iPhone memory?

How to display iPhone free memory in a UILabel ? and I would like to ask, how to free up memory using iPhone SDK? FYI, I'm using iPhone SDK 3.1.2 with xcode 3.2.1 (Mac OS X Snow Leopard). ...

Outlook 2007 Add-in Memory Leak?

Hi all, I've created a simple Outlook 2007 add-in using C# which loops through a selection of Messages and examines their attachments. I'm running this add-in on a set of ~25,000 selected Messages. Immediately, however, I notice the memory usage of Outlook (seen via perfmon) shooting up. After running the add-in in debug mode, line-b...

Memory profiling tool for Delphi?

I set up a project and ran it, and looked at it in Process Explorer, and it turns out it's using about 5x more RAM than I would have guessed, just to start up. Now if my program's going too slowly, I hook it up to a profiler and have it tell me what's using all my cycles. Is there any similar tool I can hook it up to and have it tell m...

C Question: Array declared inside a function cant exceed ~8MB of memory. What am I doing wrong?

Hi, while using Eclipse on a Mac (2GB RAM) i have encountered the following problem: whenever i try to create an array which exceeds 8384896 bytes, i get segmentation faults. The following program would execute: #include <stdio.h> main() { double x[1048112]; printf("sizeof(x) = %li", sizeof(x)); } and the output would be (as...