memory-leaks

NSArray* excludedActivities Leaks memory even when using ARC and setting it to nil

坚强是说给别人听的谎言 提交于 2019-12-24 15:27:09
问题 I'm trying to use the new iOS6 UIActivityViewController and it works fine except that the Memory Leaks instrument says that the NSArray *execludedActivities is leaking every time I try to show the controller. Note that I tried to use an NSArray called excludedActivities and then set the shareShareController.excludedActivityTypes to be able to set the array to nil later (all that is commented code below) but now I'm setting the property directly and still there is a leak. - (IBAction)share:(id

Is pointer to variable the same as a pointer to an array of one element, or of zero elements?

倖福魔咒の 提交于 2019-12-24 14:47:54
问题 Array with size 0 Has good explanations of zero-length arrays and is certainly worthwhile and pertinent. I am not seeing it compare zero-length with single-element arrays and with pointer-to-variable. When I asked before (Is c++ delete equivalent to delete[1]?) I did not express myself well. My question seemed to be the same or included in more general answers about new, new[], delete, and delete[]. Some understood that I was asking only about a single element. All answers in comments seemed

Why does this Swift code leak memory, and how do I handle it?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 14:37:50
问题 This Swift code (based on another post here on Stack Overflow) computes ten million MD5 hashes (and does nothing with them, for the sake of this example). But the md5() function leaks memory; the longer it runs, the more memory it consumes: import Foundation func md5(string: String) -> [UInt8] { var digest = [UInt8](count: Int(CC_MD5_DIGEST_LENGTH), repeatedValue: 0) if let data = string.dataUsingEncoding(NSUTF8StringEncoding) { CC_MD5(data.bytes, CC_LONG(data.length), &digest) } return

rake task memory leak

喜夏-厌秋 提交于 2019-12-24 13:12:37
问题 I have a long running rake task that is gobbling up all my system memory over time? What is the quickest way to track down my issue and get to the bottom of it? Im using rails 2.3.5, ruby 1.8.7, ubuntu on slicehost and mysql 5. I have rails app that works fine. I have a nightly job that runs all night and does tons of work (some external calls to twitter, google etc, and lots of db calls using active record, over time that job grows in memory size to nearly 4 gig. I need to figure out why the

How to fully unbind a GL_ELEMENT_ARRAY_BUFFER?

走远了吗. 提交于 2019-12-24 13:07:11
问题 I'm working on a multithreaded app that simultaneously renders geometry to multiple FBOs. I'm experiencing a leak (as described on this question). I've been able to narrow it down a little — if I make one change, it stops leaking — but I can't figure out why. On each of 4 threads (each with its own shared context), I'm doing the following each render cycle: // Upload positionBuffer = getUnusedArrayBufferFromPool(); glBindBuffer(GL_ARRAY_BUFFER, positionBuffer); glBufferData(GL_ARRAY_BUFFER,

Guzzle: Uncaught exception & memory leak

落爺英雄遲暮 提交于 2019-12-24 12:41:31
问题 I'm having weird issues while using Guzzle When I try to simulate an erroneous request (e.g. a request which returns a status code 404) Guzzle throws a ClientException containing all the details of why that request failed. When I try to catch this exception my script exits with a fatal error stating that I didn't catch the exception and it shows an XDebug trace stating that I had a memory leak somehow. My code looks like this: Note: httpClient is a valid instance of GuzzleHttp/CLient.

Analyzing kmemleak result

北战南征 提交于 2019-12-24 12:09:26
问题 I am running kmemleak on one of my modules to find leaks, below is the result after a while. From the result, what i understand is below address are object/s address in the .ko or .o file. unreferenced object 0xffff8803c9708f10 (size 32): comm "resiter_access_i_o", pid 2320, jiffies 4294798486 hex dump (first 32 bytes): d8 8e 70 c9 03 88 ff ff a0 8e 70 c9 03 88 ff ff ..p.......p..... 68 8e 70 c9 03 88 ff ff 30 8e 70 c9 03 88 ff ff h.p.....0.p..... backtrace: [<ffffffff81516e3e>] kmemleak

Memory leak with CFArray in ARC

时光怂恿深爱的人放手 提交于 2019-12-24 11:33:45
问题 I've made an iPhone app using ARC that accesses every entry in the address book, and then every address for every person. The data is stored in CFArrays, which are toll-free bridged to NSArrays. The code is below. ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef arrayRef = ABAddressBookCopyArrayOfAllPeople(addressBook); NSArray *peopleArray =[(__bridge NSArray *) arrayRef copy]; CFRelease(arrayRef); arrayRef = nil; for(id personId in peopleArray) { ABRecordRef person = (_

leaks tool doesn't report memory leak on os x

醉酒当歌 提交于 2019-12-24 11:25:38
问题 I am trying to learn how to use leaks tool from the command line, here is my code that should produce a leak on NSString : #import <Foundation/Foundation.h> #import <unistd.h> int main(int argc, const char *argv[]) { NSString *string = [[NSString alloc] init]; pid_t pid = getpid(); NSLog(@"pid: %d", pid); string = nil; [NSThread sleepForTimeInterval:20]; return 0; } I learned that leaks refreshes itself every 10 seconds (not sure if this is true, but I set the interval to 20 seconds). This

jQuery code causing memory leak

坚强是说给别人听的谎言 提交于 2019-12-24 11:16:09
问题 The following code is causing a memory leak (you can see this happening the more you hover in and out the slower it gets). Unfortunately I am unable to download a javascript profiler in my office (I can, it will just take me a few days/ weeks). Here is the code, just some simple transitions for a dropdown menu: $(document).ready(function(){ breadcrumbOver = function () { $(this).stop().animate({ backgroundColor: "#3393b5", textIndent: 15 }, 250); } breadcrumbOut = function () { $(this).stop()