Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting message just leaking memory

Hi friend i have message on console (it's not give error or warning )it only show message the message it's like that

 __NSAutoreleaseNoPool(): Object 0x6378190 of class HGMapPath autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6379e00 of class HGMovingAnnotation autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x578f2e0 of class __NSCFSet autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790a00 of class __NSDate autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790ab0 of class __NSCFTimer autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6348c90 of class UIView autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x633fb60 of class UILayoutContainerView autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6379c10 of class __NSArrayI autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790e20 of class MKDirectionsRouteInfo autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6371a40 of class MKDirectionsRouteInfo autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x63799c0 of class NSCFString autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6371e30 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x636d850 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790cf0 of class __NSArrayI autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d10 of class __NSArrayI autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790e90 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d30 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d40 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d50 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d60 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d70 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d80 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790d90 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6379b40 of class __NSArrayI autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6375300 of class CABasicAnimation autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790b40 of class CABasicAnimation autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790ed0 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x5790ee0 of class NSCFNumber autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x634d210 of class CABasicAnimation autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x6379b60 of class CABasicAnimation autoreleased with no pool in place - just leaking
 __NSAutoreleaseNoPool(): Object 0x637b870 of class __NSCFDictionary autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6371960 of class NSThread autoreleased with no pool in place - just leaking

I just want know why it is happening .Is that it create problem in future .And How can i solve

I am using this code please check it out And suggest me best way to solve this.

//start tracking vehicle locations. In DEMO mode just read locations from the path...
- (void) start
{
  [self performSelectorInBackground:@selector(startTracking) withObject:nil];
}

- (void) stop 
{
  [NSObject cancelPreviousPerformRequestsWithTarget:self];
  self.isMoving = NO;
}


- (void) startTracking
{
    self.isMoving = YES; 

    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

  for(int i=_currentPathPointIndex+1; i<path.pointCount; i++)
  {

    currentLocation = self.path.points[i]; 

    _distanceTravelled += MKMetersBetweenMapPoints(self.path.points[i], self.path.points[i-1]);

      //send notification
      [[NSNotificationCenter defaultCenter] postNotificationName:kObjectMovedNotification object:self]; 

      [NSThread sleepForTimeInterval : DEMO_SPEED];
  }

  //finished moving along the path - send notification
  [[NSNotificationCenter defaultCenter] postNotificationName:kObjectRechedEndOfPathNotification object:self]; 

  [pool drain];
}

Thanks in advance

like image 970
user733928 Avatar asked Dec 07 '22 21:12

user733928


1 Answers

When getting the "no pool in place error" set the debugger set environment variable NSAutoreleaseHaltOnNoPool to YES when the process launches. This will cause the debugger to break when one of those messages is emitted. At this point the callstack should help you figure out where you need to add the auto release pool.

The tidbit of information about NSAutoreleaseHaltOnNoPool and many other debug tools can be found in NSDebug.h.

like image 123
Evan Avatar answered Dec 23 '22 23:12

Evan