memory

.NET: Random number or number of free bytes in memory?

How can I get the number of free bytes available in memory, in .NET? Also, can you think of a potentially better random number beside new Random().Next(), DateTime.Now.Ticks, or available system memory? ...

Creating memory snapshot from inside the code (Java)

Is there a possibility, that from inside your program, by calling some java library, make java create memory snapshot of that program? (default .hprof file) ...

C memcpy() a function

Hi guys, Is there any method to calculate size of a function? I have a pointer to a function and I have to copy entire function using memcpy. I have to malloc some space and know 3rd parameter of memcpy - size. I know that sizeof(function) doesn't work. Do you have any suggestions? ...

Memory Leak / Form not being garbage collected.

I'm tracking down a Memory leak within an MDI application. Opening, and then closing the form results in the form staying in memory. Using Ant's memory profiler, I can get the following graph of references keeping the form in memory. I have removed any and all events we attach to the combo controls when Dispose fires on the form. Can a...

Is there a freeware utility out there to monitor a c++ application for memory leaks?

I am verifying an application coded in c++ with memory leak and need a utility (freeware) I can easily run to detect where it is ocurring. any ideas? ...

c# windows service problem with memory (memory leak?)

Hi all, I have a little problem with memory management in a Windows Service written in C# (framework 3.5, visual studio 2008). The service run fine, with a Timer and a CallBack the fire the procedure every 3 minutes. Therefore, the memory in the Windows Task Manager slowly growing at every timer's run. Have you an idea to how resolve t...

Can memory leaks in .NET lead to a corrupted disk? (Error creating window handle)

Related to this question (I too have had this error in an application). "Error creating window handle" due to too many non disposed controls. Can this lead to Windows crashing and refusing to start, even refusing to be reinstalled, even when reformatting the drive (only quick reformat)? Because that seems to have happened to me. Edit a...

PHp - memory error when resizing a PNG image

Hi all, I have a script that creates a thumbnail out of an uploaded image. it works fine with jpgs, but gives me an error Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 26250000 bytes) when I upload a png image. The script is: //create thumbnail; $modwidth and height are calculated in another pa...

Copy bytes in memory to an Array in VB.NET

Hello, unfortunately I cannot resort to C# in my current project, so I'll have to solve this without the unsafe keyword. I've got a bitmap, and I need to access the pixels and channel values directly. I'd like to go beyond Marshal.ReadByte() and Marshal.WriteByte() (and definitely beyond GetPixel and SetPixel). Is there a way to put a...

FLVs on timeline are glitching out

I have a Movieclip with about five FLV movies embedded on its timeline, one after another. I am loading multiple instances (about 5-10) of this movieclip onto the stage. Once added to the stage, they each play there timelines in a loop. The problem is that when one of the instances switch over to playing a new FLV, then some of the oth...

How to speed up Visual Studio 2008? Add more resources?

Hello, I'm using Visual Studio 2008 (with the latest service pack) I also have ReSharper 4.5 installed. ReSharper Code analysis/ scan is turned off. OS: Windows 7 Enterprise Edition It takes me a long time (2 minutes) to run the debugger, compiler, and if I save a file in my app_code folder it locks up for 2 minutes. I have 12 Gb of r...

How do I correctly use SDL_FreeSurface when dealing with a vector of surfaces.

I have setup a small shooter game as a tutorial for myself in SDL. I have a struct of a projectile struct projectile { SDL_Surface* surface; int x; int y; }; And I put that into a vector. vector<projectile> shot; projectile one_shot; And when I press space I create a new projectile and add it to the vector and then they...

Is JDBC a big memory hog?

I need to access (read in) data repeatedly from a database in my java codes, and therefore adopted JDBC. However, it seems to me that using JDBC takes up a lot of memory. I tried to be careful about closing the objects created for JDBC (ResultSet, Statemenet), but still it seems to hog a lot of memeory especially compared to reading in i...

How to unload cleanly an Adobe Captivate SWF from Flash Player 9 (not 10)

Why doesn't Adobe follow their own advice and have a Captivate swf listen for its own UNLOAD event, and clean up all its timers, event listeners, external references, etc. I'm finding it VERY DIFFICULT to get an Adobe Captivate swf out of the flash player's memory once loaded in with the Loader. Clearly, the unloadAndStop method isn't ...

Load image into memory immediately

I need to open all frames from Tiff image in WPF into memory and then delete the source. And after that I eventually need to render that image (resized according to window size). My solution is quite slow and I cannot delete file source before the first require. Any best practices? ...

How to make a new list to point somewhere else, Lisp

Hello. The title is self-explanatory. How can I build a new list X from another list Y (same structure), but the resulting list pointing somewhere else in memory area, practically, another object? I tried with make-list :initial-element Y or appending to an empty list, but I still get the same object. Thanks! ...

Can't free memory of NSData object

Hi, i'm new to xcode / cocoa and even objective-c thus my question might be stupid. Im trying to write a program that will hash files in a folder. I looked around and found a way to load a file via a NSData object and than hash it's bytes with CC_SHA512. If i try to hash a few more files i noticed my memory running out. Using the Run -...

Odd characters in memory

While I was running my debugger I decided to examine a specific spot in memory and noticed that there are some odd characters ¾㵎䐑톢హ��洓. Does anyone know what this is? ...

Why does my simple GLX app leak memory?

The code below shows a small 48 byte leak in valgrind. #include <X11/Xlib.h> #include <GL/glx.h> #include <unistd.h> int main( int argc, char* argv[] ) { Display* _display; Window _windowHandle; XVisualInfo* _visual; GLXContext _context; Atom _deleteWindowMessage; Atom _pingWindowMessage; _display = XOpenDi...

Python: Behavior of the garbage collector

I have a Django application that exhibits some strange garbage collection behavior. There is one view in particular that will just keep growing the VM size significantly every time it is called - up to a certain limit, at which point usage drops back again. The problem is that it's taking considerable time until that point is reached, an...