memory

winforms application memory usage

is there anyway i can have my application tell how much memory the user has and if the application is getting close to taking up a high percentage of that. also, how do you know how much memory the machine gives to OS, video cards, etc . . for example, if you have 4gb of memory, how much actual memory is given to applications, can you ...

SQLite Performance Benchmark -- why is :memory: so slow...only 1.5X as fast as disk?

Why is :memory: in sqlite so slow? I've been trying to see if there are any performance improvements gained by using in-memory sqlite vs. disk based sqlite. Basically I'd like to trade startup time and memory to get extremely rapid queries which do not hit disk during the course of the application. However, the following benchmark giv...

Track down Memory leaks in a Ruby Script

Hello! I have created a Ruby XMPP Framework called babylon. I have then created a few applications with it and even though they run pretty smoothly, it seems that they're eating my computer memory bit by bit. I suspected leaks, so first, I added this at some point in my code : puts `ps -o rss= -p #{Process.pid}`.to_i As suspected, t...

Improvements for this C++ stack allocator?

Any suggestions for my stack based allocator? (Except for suggestions to use a class with private/public members) struct Heap { void* heap_start; void* heap_end; size_t max_end; Heap(size_t size) { heap_start = malloc(size); heap_end = heap_start; max_end = size + (size_t) heap_start; } ...

PHP reaching memory limit causes function to rerun

So I have a very odd issue. First, I'm using PHP 5.2.6 (as part of MAMP, though this also happens on a LAMP server running 5.2.6 as well), writing a web site using Zend Framework 1.7.2. Second, the software I'm writing does a rather complicated statistical calculation that requires a lot of memory. Usually it runs fine with 128MB set ...

Is the memory not reclaimed for Delphi apps running on Windows Server 2008 (sp1) ?

We have a D2007 application whose memory footprint grows steadily when running on Windows Server 2008 (x64, sp1). It behaves normally on Windows Server 2003 (x32 or x64), XP, etc... where it goes up and down as expected. We have tried with the included Memory Manager or the latest FastMM4 4.92 with the same results. Has anyone tried t...

Cross-platform memory allocator sbrk/virtualalloc

I am wondering if there is a cross-platform allocator that is one step lower than malloc/free. For example, I want something that would simply call sbrk in Linux and VirtualAlloc in Windows (There might be two more similar syscalls, but its just an example). ...

C#: Search a byte[] array in another process's memory.

Hello, How is it possible to search for a byte[] array in the memory of another process and then get the address at the place where the byte[] array is located? I want to write a byte array into the memory of another process(WriteProcessMemory()).One of the parameters of that call is uint Address.Well I want to get the address by searc...

How do I allocate a std::string on the stack using glibc's string implementation?

int main(void) { std::string foo("foo"); } My understanding is that the above code uses the default allocator to call new. So even though the std::string foo is allocated on the stack the internal buffer inside of foo is allocated on the heap. How can I create a string that is allocated entirely on the stack? ...

How do you make your Java application memory efficient?

How do you optimize the heap size usage of an application that has a lot (millions) of long-lived objects? (big cache, loading lots of records from a db) Use the right data type Avoid java.lang.String to represent other data types Avoid duplicated objects Use enums if the values are known in advance Use object pools String.intern() ...

Executable sections marked as "execute" AND "read"?

I've noticed (on Win32 at least) that in executables, code sections (.text) have the "read" access bit set, as well as the "execute" access bit. Are there any bonafide legit reasons for code to be reading itself instead of executing itself? I thought this was what other sections were for (such as .rdata). (Specifically, I'm talking abou...

Control SQL Server CLR Reserved Memory

I've recently enabled CLR on my 64 bit SQL Server 2005 machine for usage of about 3 procs. When I run the following query to gather some info on memory usage... select single_pages_kb+ multi_pages_kb + virtual_memory_committed_kb as TotalMemoryUsage, virtual_memory_reserved_kb from sys.dm_os_memory_clerks where type = 'MEMORYCLERK_...

Datastructure + Algorithm for storing non-overlapping intervals

Hi, I was wondering if any of you guys knew of a space efficient way of storing non overlapping intervals. My end goal is to use this to allocate virtual address space (I am writing an operating system for fun) and wanted to know if one could store the regions of free space in better than O(n) space complexity and O(n) search complexity....

Reducing the amount of threads in a .NET application

I have a medium-sized process viewer which uses around ~40MB of private memory on Windows Vista. The problem is that people always compare this number to the amount of memory used by Process Explorer and similar, unmanaged tools. I've noticed that when my program is idle, there are 13 running threads: One RPC thread (RPCRT4.dll!Thread...

How to find memory used by each object in a program?

Hello, How do I find out about the memory used by each object in a program? For example : I want to know how much memory(in Kb) is used by this object "someclassinstance".. someclass someclassinstance=new someclass(); I can see the total memory used by the application in the task manager...But Is there a way to see detailed report ab...

Are memory mapped files bad for constantly changing data?

I have a service that is responsible for collecting a constantly updating stream of data off the network. The intent is that the entire data set must be available for use (read only) at any time. This means that the newest data message that arrives to the oldest should be accessible to client code. The current plan is to use a memory ma...

Memory handling by a 64bit Citrix server running instances of a 32bit app using WoW64

Can a 64bit Citrix server running a 32bit app through WoW64 handle just as many instances/users as the 32bit Citrix server equivalent? And if so if I up the memory in the 64bit server will the number of instances/users scale too? Or are there some strange memory considerations with a 64bit server running a 32bit app? ...

Smart pointers/safe memory management for C?

Hi, I, and I think many others, have had great success using smart pointers to wrap up unsafe memory operations in C++, using things like RAII, et cetera. However, wrapping memory management is easier to implement when you have destructors, classes, operator overloading, et cetera. For someone writing in raw C99, where could you point ...

OpenCV to use in memory buffers or file pointers

The two functions in openCV cvLoadImage and cvSaveImage accept file path's as arguments. For example, when saving a image it's cvSaveImage("/tmp/output.jpg", dstIpl) and it writes on the disk. Is there any way to feed this a buffer already in memory? So instead of a disk write, the output image will be in memory. I would also like t...

Is Python faster and lighter than C++?

I've always thought that Python's advantages are code readibility and development speed, but time and memory usage were not as good as those of C++. These stats struck me really hard. What does your experience tell you about Python vs C++ time and memory usage? ...