Memory consumption growing

External developers... This forum's for you!

Memory consumption growing

Postby sctell » Mon Oct 17, 2011 3:27 am


I have a table made up of individual fields.

I have an array which has been passed into the XFCN along with the number of rows and columns.

From within SC I call the XFCN routine displayData with the first record to display then loop through the rows calling displayRow which then calls sendSCMessage to place the string into the SC field.

I have noted when repeatedly calling these routines that the memory footprint for SC as reported in activity monitor continues to rise.

Can anyone explain why?

Code: Select all
   int tStartRec = [[myPBlock parameterAtIndex:2]intValue];
   int tRow;   
   NSArray* tRowArray;
   [self sendSCMessage:@"lock screen"];
   for(tRow = 0;tRow < pNumOfRows;tRow++)
      tRowArray = [pCellData objectAtIndex:tRow + tStartRec];
      [self displayRow:tRow withData:tRowArray];
   [self sendSCMessage:@"unlock screen"];

-(void)displayRow:(int)tRow withData:(NSArray*)tData
   int tCol;
   for(tCol = 0; tCol < pNumOfCols;tCol++)
      NSString* tFldName  = [[NSString alloc]initWithFormat:@"set the text of cd fld \"%@,%i,%i\" to \"%@\"",pTableName,tRow + 1,tCol + 1,[tData objectAtIndex:tCol]];
      [self sendSCMessage:tFldName];
      [tFldName release];

-(void)sendSCMessage: (NSString*)superTalkStatement
   Str255      theMessage;
   [self setStringPtr: theMessage toString: superTalkStatement];
   SendCardMessage(par, theMessage );

-(void)setStringPtr: (StringPtr)theString toString: (NSString*)str
   NSData* textData = [str dataUsingEncoding: NSMacOSRomanStringEncoding];
   theString[0] = [textData length];
   memmove( theString +1, [textData bytes], theString[0] );
Posts: 1130
Joined: Sun Jul 06, 2008 10:41 am

Return to Xcode and the Internals Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest