memory-leaks

WPF memory leak with custom control

可紊 提交于 2019-12-24 10:39:40
问题 I want to dispose of a control I'm dynamically adding to my app. The garbage collector is not picking up the object after I .Remove() it from its parent control, and it has huge bitmaps and geometry private members. I want to be able to do something like this: foreach (ScrollItem mylabel in canvas1.Children) { if (mylabel.bRemove == true) { canvas1.Children.Remove(mylabel); mylabel = null; // or mylabel.Dispose(); } } canvas1 can't have null items in a UIObjectCollection so I can't set it to

Can jQuery click events be unbound or reset?

∥☆過路亽.° 提交于 2019-12-24 10:39:03
问题 I've discovered a resource leak on a webpage I'm working on. This webpage has two textfields, that upon click show a modal dialog, perform a data request to the backend, and then present that information in a table that the user can select an entry from for use in the textbox they originally clicked. I'm binding the click events to the textboxes like so: var $field = $('#one-of-the-text-fields'); $field.click(function () { App.DialogClass.show(); App.DialogClass.PopulateTable(); App

How do I check if ConcurrentLinkedQueue leaves garbage (dereferenced instances) for the GC?

久未见 提交于 2019-12-24 10:35:56
问题 I am using a bunch of ConcurrentLinkedQueue s in my application and the GC overhead is huge. How do I check if the ConcurrentLinkedQueue is the culprit? Is there a standard way in Java to profile these data structures for memory allocation/deallocation? 回答1: One way to do it is to write a simple test program and run it with the -verbose:gc JVM option. For example, the code: import java.util.concurrent.ConcurrentLinkedQueue; public class TestGC { public static void main(String[] args) throws

Android Bitmap Memory Leak, what to do more

淺唱寂寞╮ 提交于 2019-12-24 10:27:36
问题 I'm building an app where you have the function to upload a post with an image. When the user picks the image I show a thumbnail of it but when I change the screen orientation I get a memory leak. I managed to get it down to the point where it takes about 25 orientation changes to leak memory but can I completely avoid it? This is the code I use for the bitmap, private ImageView miniPicture; private String imagePath; private WeakReference<Bitmap> imageBitmap; .... BitmapFactory.Options

Windows Task Manager shows process memory keeps growing even though there are no memory leaks

坚强是说给别人听的谎言 提交于 2019-12-24 10:02:15
问题 My application keeps consuming more and more memory as seen in the Windows Task Manager and eventually crashes due to OutOfMemory. However when i check for leaks using MemoryValidator (from www.softwareverify.com) no leaks are detected. Why is this happening? 回答1: Just because there is a growing amount of memory usage doesn't mean it is necessarily 'leaking'. You could simply be accumulating a large number of live objects and/or very large ones (containing lots and lots of data). If you can

Memory leak — setting variable in init?

China☆狼群 提交于 2019-12-24 09:51:45
问题 Memory management has me confused again -- In my .h file, I have: @property (nonatomic,retain) NSMutableDictionary *properties; In my .m, I have the following init method, which complains of a leak in Instruments on the self.properties line: - (id) init { self = [super init]; self.properties = [[NSMutableDictionary alloc] init]; return self; } It also complains of a leak if I don't use the accessor. Likewise, it leaks if I use this strategy: NSMutableDictionary *temp = [[NSMutableDictionary

Is there any way that I can free up memory in the java code that is generated to bind C code via JNI/JNA?

偶尔善良 提交于 2019-12-24 09:39:39
问题 I am using a java library that use JNA to bind to the original C library (That library is called Leptonica). I encountered a situation where free(data) has to be called in the C code to free up the memory. But, is there any function in java that I can free up the memory? In the C code void ImageData::SetPixInternal(Pix* pix, GenericVector<char>* image_data) { l_uint8* data; size_t size; pixWriteMem(&data, &size, pix, IFF_PNG); pixDestroy(&pix); image_data->init_to_size(size, 0); memcpy(&(

Thread Stack leak through a recursive function

感情迁移 提交于 2019-12-24 09:28:12
问题 I have following scenario, in C implementation with pthreads : The main thread(T1) creates another thread(T2) which waits for an event. On an event T2 calls a Tree Traversal recusive function that takes in a function pointer for an action to be executed on a Tree node. During Tree traversal, if the node is found the fn pointer is fired that creates a thread (T3), services the node and is supposed to normally die out. I am observing a huge memory leak that comes from the T3's stack. The

WebView: libdispatch leaks in an ARC-enabled app

删除回忆录丶 提交于 2019-12-24 09:23:53
问题 In a doc-based ARC-enabled application I have a WebView that is opening an HTML file. The idea is to do some editing, and then save to WebArchive. When I run Instruments I find random leaks as in the image below. I am not initializing anything with malloc , why am I getting them? (I get the leaks when I start opening and closing windows.) Document.h #import <Cocoa/Cocoa.h> #import <WebKit/WebKit.h> @interface KBDocument : NSPersistentDocument { IBOutlet WebView *webView; } Document.m - (void

what is the reason for high % time in GC? for our app pool in APM perfmonitor tool, we see it crossing 99% and staying their for hours [closed]

五迷三道 提交于 2019-12-24 09:09:53
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year . Does this mean memory leakage? The %Time in GC goes to 99% even when noone is using the application. Could you please help me why this %time in GC counter is strangely behaving. this could be a code issue? application is in Asp.net and uses services to call some methods. For disposing oracle