Memory Leak

In the program, when a button that does a certain operation is clicked, a large chunk of memory is allocated without being released. New memory is allocated for every time this operation is performed until the program eventually crashes from lack of memory.

I was taught to always try to reproduce the problem first whenever I get assigned a ticket. So I look at task manager as I repeat the steps I was told to do and sure enough, the memory usage increases with every click to the corresponding button. I read code for the next four hours before I finally figure out where the allocation happens and where the release should be. After fixing it, I test again–

According to task manager, I didn’t do my job. I recompile, retest, reread, and re-edit code for the next 3 hours before I finally give up because it just seemed right. Except it isn’t, says task manager.

Eventually, I consult with the person who reported the problem and created a ticket. I think maybe the internal code isn’t correct, so I gave him the patch to test and see. But a few minutes later he comes by to say he didn’t understand my problem because the patch works. What?

I repeat the steps to reproduce the problem and showed him task manager. See? It went up!

“What is that? That’s too little memory to be for this operation.” Huh. Apparently I was looking at the wrong column. He showed me where to look and sure enough, the memory usage rises and falls (and it was ten times the amount of memory I was seeing increase before!). I was right the first time, after all.

But he’s not paying attention to my recheck because he’s looking at the tiny memory increase I just showed him. He told me to make a ticket and he’ll check it out. The day after, he fixed the problem that I thought was the problem I was supposed to fix.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: