5 Replies - 309 Views - Last Post: 17 January 2012 - 12:45 PM Rate Topic: -----

#1 livium  Icon User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 519
  • Joined: 21-December 08

Cannot see the line that caused some memory leaks

Posted 17 January 2012 - 06:13 AM

I have this huge problem: my code has some memory leaks and in the output window I am not being shown the line in the file that caused that memory leak.

Of course, the problem is huge because other memory leaks appear with the line in the file that caused the leak, but most of them (99%) don't have the address in the file.

I searched the internet for 2 days now and all the methods that i've found weren't succesfull.

This is very frustating and I cannot figure out why.

This is how the leaks appear in the output:

Detected memory leaks!
Dumping objects ->
{278321} normal block at 0x032764B0, 80 bytes long.
 Data: <    L o a d   a > 0D 00 0A 00 4C 00 6F 00 61 00 64 00 20 00 61 00 
{278288} normal block at 0x02ABFFC0, 20 bytes long.
 Data: <  x   y   x  c' > 10 1B 78 01 C8 8F 79 01 10 1B 78 01 80 63 27 03 
{278287} normal block at 0x01798FC8, 20 bytes long.
 Data: <  x  o      xb' > 10 1B 78 01 C8 6F 82 01 C0 FF AB 02 78 62 27 03 
{278286} normal block at 0x017D9FC8, 20 bytes long.
 Data: <  x  o    x 0`' > 10 1B 78 01 C8 6F 82 01 10 1B 78 01 30 60 27 03 
{278285} normal block at 0x01826FC8, 20 bytes long.
 Data: <  }       y Xa' > C8 9F 7D 01 C8 9F 86 01 C8 8F 79 01 58 61 27 03 
{278284} normal block at 0x01851FC8, 20 bytes long.
 Data: <  x       x  ]' > 10 1B 78 01 C8 9F 86 01 10 1B 78 01 F0 5D 27 03 
{278283} normal block at 0x01869FC8, 20 bytes long.
 Data: <     ?   o   _' > C8 1F 85 01 C8 3F A1 01 C8 6F 82 01 18 5F 27 03 
{278282} normal block at 0x019ECFC8, 20 bytes long.
 Data: <  x  o    x  [' > 10 1B 78 01 C8 6F 9F 01 10 1B 78 01 D0 5B 27 03 
{278281} normal block at 0x019F4FC8, 20 bytes long.
 Data: <  x  o    x  Y' > 10 1B 78 01 C8 6F 9F 01 10 1B 78 01 A8 59 27 03 
{278280} normal block at 0x019F6FC8, 20 bytes long.
 Data: < O   ?       Z' > C8 4F 9F 01 C8 3F A1 01 C8 CF 9E 01 B0 5A 27 03 
{278279} normal block at 0x01A13FC8, 20 bytes long.
 Data: < o   /t      \' > C8 6F 9F 01 C8 2F 74 02 C8 9F 86 01 E8 5C 27 03 
{278278} normal block at 0x01A5CFC8, 20 bytes long.
 Data: <  x       x  W' > 10 1B 78 01 C8 AF A7 01 10 1B 78 01 98 57 27 03 
{278277} normal block at 0x01A73FC8, 20 bytes long.
 Data: <  x       x pU' > 10 1B 78 01 C8 AF A7 01 10 1B 78 01 70 55 27 03 
{278276} normal block at 0x01A7AFC8, 20 bytes long.
 Data: < ?    t      V' > C8 3F A7 01 C8 0F 74 02 C8 CF A5 01 88 56 27 03 
{278275} normal block at 0x01AE9FC8, 20 bytes long.
 Data: <  x   q   x (S' > 10 1B 78 01 C8 8F 71 02 10 1B 78 01 28 53 27 03 
{278274} normal block at 0x01B6CFC8, 20 bytes long.
 Data: <  x   q   x  Q' > 10 1B 78 01 C8 8F 71 02 10 1B 78 01 08 51 27 03 
{278273} normal block at 0x02718FC8, 20 bytes long.
 Data: <      t      R' > C8 CF B6 01 C8 0F 74 02 C8 9F AE 01 18 52 27 03 
{278272} normal block at 0x02740FC8, 20 bytes long.
 Data: <  q  /t     0T' > C8 8F 71 02 C8 2F 74 02 C8 AF A7 01 30 54 27 03 
{278271} normal block at 0x02742FC8, 20 bytes long.
 Data: <  t      ?   X' > C8 0F 74 02 C8 7F 89 02 C8 3F A1 01 A0 58 27 03 
{278270} normal block at 0x027A3FC8, 20 bytes long.
 Data: <  x       x  N' > 10 1B 78 01 C8 DF 81 02 10 1B 78 01 E8 4E 27 03 
{278269} normal block at 0x027DBFC8, 20 bytes long.
 Data: <  x       x  L' > 10 1B 78 01 C8 DF 81 02 10 1B 78 01 D0 4C 27 03 
{278268} normal block at 0x0281DFC8, 20 bytes long.


and it goes like this forever.

Please help me man, i'm desperate!!!

This post has been edited by livium: 17 January 2012 - 06:28 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Cannot see the line that caused some memory leaks

#2 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2889
  • View blog
  • Posts: 10,004
  • Joined: 08-August 08

Re: Cannot see the line that caused some memory leaks

Posted 17 January 2012 - 06:27 AM

How many objects do you allocate memory for? It looks like you have one that takes up 80 bytes and another that takes up 20, and the 20 byte object appears to be allocated memory many times without being deallocated.
Was This Post Helpful? 1
  • +
  • -

#3 livium  Icon User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 519
  • Joined: 21-December 08

Re: Cannot see the line that caused some memory leaks

Posted 17 January 2012 - 06:37 AM

I have this automaton, which contains a number of 1500000 of states.
But I took care to delete them all in the destructor,and this is something which I verified.
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2889
  • View blog
  • Posts: 10,004
  • Joined: 08-August 08

Re: Cannot see the line that caused some memory leaks

Posted 17 January 2012 - 07:27 AM

It's not the number of states or instances of objects that I asked about. It's the number of objects. In how many places in the code do you allocate memory for them? I'm sure that's far less than 1,500,000.
Was This Post Helpful? 1
  • +
  • -

#5 livium  Icon User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 519
  • Joined: 21-December 08

Re: Cannot see the line that caused some memory leaks

Posted 17 January 2012 - 07:36 AM

Let's forget it.
It's my fault that I put this question.
It's way to complex a problem to be solved on a forum.

Thanks anyway.
Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6036
  • View blog
  • Posts: 23,421
  • Joined: 23-August 08

Re: Cannot see the line that caused some memory leaks

Posted 17 January 2012 - 12:45 PM

Is your program Windows specific, or will it run on Linux? If it will run on Linux, then I would suggest you run it through valgrind, which will help you to ferret out the leak(s).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1