memory

Create a Java File object (or equivalent) using a byte array in memory (without a physical file)

I want to create a Java File object in memory (without creating a physical file) and populate its content with a byte array. Can this be done? The idea is to pass it to a Spring InputStreamSource. I'm trying the method below, but it returns saying "the byte array does not contain a file name.". MimeMessage message = mailSender.create...

IIS6 on Windows 2003 Enterprise Edition x32 and Memory

Hi, I have ASP.NET 2.0 applications running on 32 bit Windows 2K3 Standard edition with 4GB of RAM. I want to upgrade the server to Enterprise edition and add more memory to a total of 6GB. I assume that I will need to enable PAE extensions to do this. How much of this extra 2GB will be usable to the W3WP worker processes? The root iss...

Determine physical mem size programmatically on OSX

We're trying to find out how much physical memory is installed in a machine running Mac OS X. We've found the BSD function sysctl(). The problem is this function wants to return a 32 bit value but some Macs are able to address up to 32 GB which will not fit in a 32 bit value. (Actually even 4 GB won't fit in a 32 bit value.) Is there ano...

When is it appropriate to use C++ exceptions?

I'm trying to design a class that needs to dynamically allocate some memory.. I had planned to allocate the memory it needs during construction, but how do I handle failed memory allocations? Should I throw an exception? I read somewhere that exceptions should only be used for "exceptional" cases, and running out of memory doesn't seem ...

Is there a better way to reverse an array of bytes in memory?

typedef unsigned char Byte; ... void ReverseBytes( void *start, int size ) { Byte *buffer = (Byte *)(start); for( int i = 0; i < size / 2; i++ ) { std::swap( buffer[i], buffer[size - i - 1] ); } } What this method does right now is it reverses bytes in memory. What I would like to know is, is there a better way to g...

Monitoring ASP.NET application memory from within the application

I'm looking for a way for the application itself to monitor the amount of memory it is using, so I can record it in a log file every hour or so and keep an eye on the applications usage. Its all hosted so we can make changes to the system to see what is going on so the solution will have to be from within the application code. We may i...

IMAGE_FILE_LARGE_ADDRESS_AWARE and 3GB OS Switch

If a Windows application has the IMAGE_FILE_LARGE_ADDRESS_AWARE set in the image header (via the /LARGEADDRESSAWARE compiler flag), this is typically to allow a 32-bit application to use more than 2GB of memory (only makes sense if the 32-bit Operating System has set the 3GB switch in boot.ini). See MSDN article /3GB for more info. My ...

Unmanaged VC++ Application's memory consumption on windows server

OK, so I have a very large multi-threaded unmanaged c++ application (server) that runs on a windows 2003 server. It hosts sessions for 20-50 concurrent users doing all sorts of business logic... At times it can be using a very large amount of memory due to things like object/session caching due to users having large numbers of windows o...

Allocating large blocks of memory with new.

I have the need to allocate large blocks of memory with new. I am stuck with using new because I am writing a mock for the producer side of a two part application. The actual producer code is allocating these large blocks and my code has responsibility to delete them (after processing them). Is there a way I can ensure my application i...

Installing odd number of DDR memory modules

I have three DDR PC 3200 memory modules, two of which are 512 MB and one of which is 1 GB. My motherboard manual describes 1-, 2-, and 4-modules configurations; is it okay to install three? ...

Does the .NET Streams save memory?

Example: If I read a file and copy it to another file through .NET Streams will the total size of the file occupy the memory at any moment? Or will the bytes be discarded as soon as they are used? If the naive approach doesn't saves memory would buffered Streams do it? ...

Windows Stalls When My Program Uses Swapfile

I am running a user mode program on normal priority. My program is searching an NP problem, and as a result, uses up a lot of memory which eventually ends up in the swap file. Then my mouse freezes up, and it takes forever for task manager to open up and let me end the process. What I want to know is how I can stop my Windows operating...

OutOfMemoryException On Mobile Device

I'm developing an application that uses a mobile device to take a photo and send it using a webservice. But after I've taken 4 photos I am getting an OutOfMemoryException in the code below. I tried calling GC.Collect() but it didn't help either. Maybe someone here could be give me an advice how to handle this problem. public static Bitm...

What is the difference between Fixed and Unsafe.

Why are there 2 different ways lock memory in place in .NET? What is the difference between them? ...

Is it possible to track memory usage in a C# application without using a profiler?

I'd like to write a simple application which keeps track of its current memory usage, number of created objects etc. In C++ I'd normally override the new operator, but for obvious reasons I can't do this in C#. Is there any way to do this without using a profiler? ...

Memory modifying in C++

im trying to learn to modify games in C++ not the game just the memory its using to get ammo whatnot so can someone point me to books ...

How to get object size in memory ?

I need to know how much bytes my object consumes in memory (in C#). for example how much my hashtable, or SortedList, or List. ...

Correct way to use UIActionSheet Delegate? Pointers Mapped to identical Memory

I am using the actionSheet variable passed by actionSheet:didDismissWithButtonIndex: to compare the calling actionSheet to a list of UIActionSheet variables in my class. This seems to be the way the delegate method was designed to differentiate between events. - (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(N...

Access Violation

Greetings everyone, going to need some help in clearing this exception. I get the following when debugging my compiled program in Microsoft Visual C++ 6.0: Loaded 'ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\tsappcmp.d...

Web server capacity planning: more cores versus more memory

We have an ASP.NET project (40 or so Web forms, 50 tables, pretty standard IO stuff with care taken to minimize when possible) that will soon need to be deployed. There will be about 100 concurrent users on the system, but only about 20 at any one time will be pounding on it it. We'll be deploying it on Windows Server 2008, 32-bit initia...