memory-leaks

What are some of the general reasons for Memory Leak and Segmentation Fault ?

What are some of the general reasons for Memory Leakage and Segmentation Fault kind of errors ? ...

Memory management and realloc

I'm going through my program with valgrind to hunt down memory leaks. Here's one that I'm not sure what to do with. ==15634== 500 (224 direct, 276 indirect) bytes in 2 blocks are definitely lost in loss record 73 of 392 ==15634== at 0x4007070: realloc (vg_replace_malloc.c:429) ==15634== by 0x807D5C2: hash_set_column(HASH*, int, ...

In C++, what's the use of having a function void foo(int** p)?

Dear all, I have been told by my colleague that this is used like an out parameter in C#, can some precisely explain how? I get the idea, but there is something that is missing.. I know that if we pass the pointer itself p to foo (*p), and the function body does p = new int(), we might have a dangling modifier! what I don't get is how f...

jQuery cluetip memory leak

Hi, I have been tracking down a memory leak in my web app which dynamically removes and adds anchors which have cluetip tooltips attached and I think that I may have narrowed down the problem to the main closure in cluetip which attaches the cluetip to the node (line 32: var link = this, $this = $(this);). I have been running the f...

Sun's Java SSL Implementation is Leaking Memory?

Hello everyone, I have a server component that I'm trying to load-test. All connections to the server use TLS 1.0. I have a simple test program that essentially does this on as many threads as I want: Full TLS handshake to the server send a request read reply close connection repeat ad nauseam My virtual machine is as follows: Java(...

HELP! Frameset Tag with Dojo use Memory Leak in IE7

Hi,there I develop the Web application with "dojo 1.3.1" now. The application uses frameset tag for a layout. the fram parts in "menu domain" and "the contents domain". When I chose a menu,"the contents domain" displays pages. "memory leak" happened, when I update screen by pushing the update button (F5Key) or when I choosing a page f...

WPF RichTextBox memory leak

In my application, I have a lot of RichTextBoxes that are created dynamically in run time. I realized that the application has a memory leak, which is caused by the RichTextBox controls. To prove that the memory leaks because of the control I wrote the following test method: for (int i = 0; i < 3000; i++) { Control r...

Looking for Multi-Platform Memory Leak detection programs.

Ok I have a school assignment to basically pick 3 memory leak detecting programs and run them on a bunch of c++ programs that the teacher supplies us and see how they compare to each other. These 3 programs have to be multi-platform and this is where I'm stuck. I have only been able to find one called valgrind which works on both MAC OSX...

fixing memory leaks when you're returning the leaked memory?

How do you fix a memory leak where you're returning from the function the leak itself? For example, I make a char* returnMe = new char[24324]; returnMe is what ends up getting returned from the function. How do you account for this memory leak? How do you destroy it once it's been returned? I have some memory management rules in plac...

Dynamic Memory Reallocation using realloc

Hello All, I am learning C++. I am trying to learn this dynamic memory allocation. In the below code I am trying to allocate memory using malloc and realloc. int main (void) { char *g = (char*) malloc (sizeof(char) * 2); g = "ab"; g = (char*) realloc (g, sizeof(char) * 200); strcpy (g, "cdefg"); cout << g << endl; return 0...

Mathematica running out of memory

I'm trying to run the following program, which calculates roots of polynomials of degree up to d with coefficients only +1 or -1, and then store it into files. d = 20; n = 18000; f[z_, i_] := Sum[(2 Mod[Floor[(i - 1)/2^k], 2] - 1) z^(d - k), {k, 0, d}]; Here f[z,i] gives a polynomial in z with plus or minus signs counting in binary. ...

Instantiating a Spring.Net context inside a static method causes a memory leak.

Hi all, Ran across this recently and wondering if someone out there can give me a good explanation. I was doing some refactoring and created a spring context to grab a configured service from an embedded config file like so: var myService = new XmlApplicationContext("assembly://MyAssembly/MyNamespace/MyService.config").GetObjec...

Python - Working around memory leaks

I have a Python program that runs a series of experiments, with no data intended to be stored from one test to another. My code contains a memory leak which I am completely unable to find (I've look at the other threads on memory leaks). Due to time constraints, I have had to give up on finding the leak, but if I were able to isolate eac...

EndInvoke() - optional or not?

Hi all, An asynchronous question: I've been reading over the internet LOTS of articles for and against Delegate.EndInvoke() being optional. Most of those articles are 4-5 years old. Lots of dead links. Can anyone explain, in .NET 2.0 - is EndInvoke() indeed preventing an otherwise-inevitable memory leak, and if yes can you please spec...

XCode>Instruments>Leaks - Where is "gather leaked memory contents" data?

When you check gather leaked memory contents in the Leaks instrument what does this do? I have a troublesome leak and thought maybe this "memory content" might be useful in tracking it down...but I can't find it!?! ...

Memory leak in loadNibNamed?

I'm about to wrap up my first iPhone app and figured I'd run it through the Leaks Performance Tool. After fixing one obvious one, the only one I have left is one with a Nib acting as a table header view loaded through loadNibNamed (I was following the Recipes demo here). - (void)viewDidLoad { [super viewDidLoad]; if (self.tab...

destory a function in javascript ( jquery )

hello guys is there anyone know how to destory a javascript ( jquery ) function? im using jquery "selectable" and a function call "edit" is fired on selectable "stop" event. inside this "edit" function i has nested switch functions with a lot of "click" event. and i have many functions within each "click" event. my problem is, everyt...

What can cause an IIS worker process to grow uncontrollably?

What can cause an IIS worker process to grow uncontrollably? I've got a bug where if I take a page and load it sometimes it adds no memory, a small amount of memory (250k-2MB) or a really large amount of memory (10MB-30MB). I have no idea what is causing this but if you can brainstorm what might cause this behaviour I'd appreciate it. ...

Qt: doesn't cause memory leak?

I was looking at Qt example here: and inside the constructor, they have: Window::Window() { editor = new QTextEdit(); // Memory leak? QPushButton *sendButton = new QPushButton(tr("&Send message")); // Memory leak? connect(sendButton, SIGNAL(clicked()), this, SLOT(sendMessage())); QHBoxLayout *buttonLayout = ne...

Running forked php apps

What are the downsides to running a forked PHP app on the web? I have read that it should not be run under Apache for any reason, but never explained why. The only reason I can think of is that if a script is terminated in the middle of execution, any forked process would never be terminated and might cause memory leaks. The question...