• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Search Kit memory use
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Search Kit memory use


  • Subject: Re: Search Kit memory use
  • From: Jesse Grosjean <email@hidden>
  • Date: Sat, 22 Nov 2003 07:39:24 -0500

When I use SearchKit it seems to be leaking memory. Basically every time I index a new document 7 new SKDocumentRef's get created and when I release the index only one of those SKDocumentRef's gets releases, so I'm left leaking 6 SKDocumentRef's.

My code for adding a document looks like this:

indexRef = SKIndexCreateWithURL(url, NULL, kSKIndexInvertedVector, NULL);
...
SKDocumentRef documentRef = SKDocumentCreateWithURL((CFURLRef)[NSURL fileURLWithPath:path]);
BOOL result = SKIndexAddDocument(indexRef, documentRef, NULL, YES);
CFRelease(documentRef);
...
CFRelease(indexRef);

The path points to a .txt file. These 3 lines seem to create 7 SKDocuments and when I later release the index the index is correctly released and one SKDocumentRef is released, but the remaining 6 of them stick around. In ObjectAlloc I see that each of the 7 SKDocuments are created with this stack trace.

malloc_zone_malloc
_CFRuntimeCreateInstance
DocKeyCreate
IADocKeyCreate
IADocKeyCreateFromFilePath
SKDocumentCreateWithURL

Am I using the API incorrectly or is this known behavior? Is there a workaround?

Thanks,
Jesse
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: classifying leading unichar as japanese kana?
  • Next by Date: Re: Where to set default user defaults?
  • Previous by thread: Re: 'class' in .h file
  • Next by thread: Reading from an NSInputStream
  • Index(es):
    • Date
    • Thread