memory-leaks

My program has a memory leak

冷暖自知 提交于 2020-01-03 03:04:22
问题 -(IBAction)play2; { CFBundleRef mainBundle = CFBundleGetMainBundle(); CFURLRef soundFileURLRef; soundFileURLRef =CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"Bear3", CFSTR ("wav"), NULL); UInt32 soundID; AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID); AudioServicesPlaySystemSound(soundID); } This is giving me an error: potential leak of an object allocated " CFBundleResourceURL returns a Core Foundation object with a +1 retain count 回答1: AudioServicesCreateSystemSoundID

iphone sdk 4.1 memory leackage: may be scene replace problem (cocos2d)

大憨熊 提交于 2020-01-02 23:02:58
问题 I have used scheduler to return from a scene to the main menu. There is nothing in the scene page except menu. But scenes are not deallocating and memory leakage increasing as i navigate through the scenes. So application is not closing(kept running in background when close using iphone/ipod button) but crashing. Hope some of you faced and resolved this type of problem.Expecting a way to out from here. Here are my class sources- Delegator @implementation BubbleWordAppDelegate @synthesize

Correctly Allocate And Fill Frame In FFmpeg

巧了我就是萌 提交于 2020-01-02 13:29:36
问题 I am filling a Frame with a BGR image for encoding, and I am getting a memory leak. I think I got to the source of the problem but it appears to be a library issue instead. Since FFmpeg is such a mature library, I think I am misusing it and I would like to be instructed on how to do it correctly. I am allocating a Frame using: AVFrame *bgrFrame = av_frame_alloc(); And later I allocate the image in the Frame using: av_image_alloc(bgrFrame->data, bgrFrame->linesize, bgrFrame->width, bgrFrame-

Correctly Allocate And Fill Frame In FFmpeg

我们两清 提交于 2020-01-02 13:28:10
问题 I am filling a Frame with a BGR image for encoding, and I am getting a memory leak. I think I got to the source of the problem but it appears to be a library issue instead. Since FFmpeg is such a mature library, I think I am misusing it and I would like to be instructed on how to do it correctly. I am allocating a Frame using: AVFrame *bgrFrame = av_frame_alloc(); And later I allocate the image in the Frame using: av_image_alloc(bgrFrame->data, bgrFrame->linesize, bgrFrame->width, bgrFrame-

Android inner classes memory leak and leak by context?

爱⌒轻易说出口 提交于 2020-01-02 10:04:16
问题 I am using Handler in my splash screen for delaying redirection to the next activity as follows.. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.entrance); screenTimeOut(); } private void screenTimeOut() { /* New Handler to start the next screen * and close this Entrance after some seconds.*/ new Handler().postDelayed(new Runnable() { @Override public void run() { initTracker(); /* Create an Intent that will start the

C# Entity Framework high memory usage, memory leak?

倖福魔咒の 提交于 2020-01-02 09:24:23
问题 I've got a small MVC webapplication running using Entity Framework 6. When starting the application by browwsing to the homepage (eg. www.mywebsite.dev) on my dev. machine the applicationpool get's started and the page get loaded as expected. Despithe the fact that the homepage is pretty ligthweight and only get's a few things from the database (2 menu's, 2 paragraphs with text, and a collection with 3-4 objects) the application pool is already > 200 MB (!) after just loading the homepage

dlopen/dlsym/dlclose (dlfcn.h) causes memory leak

╄→尐↘猪︶ㄣ 提交于 2020-01-02 07:37:53
问题 When using the dlfcn family like so: #include <stdio.h> #include <dlfcn.h> typedef int(*timefunc_t)(void*); int main() { timefunc_t fun; void* handle; handle = dlopen("libc.so.6", RTLD_LAZY); fun = (timefunc_t)dlsym(handle, "time"); printf("time=%d\n", fun(NULL)); dlclose(handle); return 0; } It causes a Memory leak: ==28803== Memcheck, a memory error detector ==28803== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==28803== Using Valgrind-3.6.1 and LibVEX; rerun with -h for

dlopen/dlsym/dlclose (dlfcn.h) causes memory leak

我是研究僧i 提交于 2020-01-02 07:37:20
问题 When using the dlfcn family like so: #include <stdio.h> #include <dlfcn.h> typedef int(*timefunc_t)(void*); int main() { timefunc_t fun; void* handle; handle = dlopen("libc.so.6", RTLD_LAZY); fun = (timefunc_t)dlsym(handle, "time"); printf("time=%d\n", fun(NULL)); dlclose(handle); return 0; } It causes a Memory leak: ==28803== Memcheck, a memory error detector ==28803== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==28803== Using Valgrind-3.6.1 and LibVEX; rerun with -h for

Why does Rust consider it safe to leak memory?

£可爱£侵袭症+ 提交于 2020-01-02 04:54:07
问题 According to this chapter in the Rust Book, it is possible to leak memory by creating a cycle of pointers: Rust’s memory safety guarantees make it difficult, but not impossible, to accidentally create memory that is never cleaned up (known as a memory leak ). Preventing memory leaks entirely is not one of Rust’s guarantees in the same way that disallowing data races at compile time is, meaning memory leaks are memory safe in Rust. We can see that Rust allows memory leaks by using Rc<T> and

GetOracleDecimal Memory Leak

倾然丶 夕夏残阳落幕 提交于 2020-01-02 04:40:06
问题 @GilShalit posted this comment a year ago: "Well, we have come to distrust ODP (.Net 2.0) after fighting a memory leak (in code we supplied to a customer) in GetOracleDecimal for over a year... Good luck!" – GilShalit Aug 27 '09 at 12:44 How did you solve it? We have a service that queries an Oracle database every few minutes that is not releasing memory; after some investigation using WinDbg I discovered that this type is piling up in the finalize queue: Oracle.DataAccess.Types.OpoDecCtx.