memory-leaks

Possible Memory leak through FinalizerReference

十年热恋 提交于 2019-12-30 17:23:15
问题 I have a small android app and I tried looking for memory leaks, so I clicked 'Dump Java Heap' and the first class on the list is FinalizerReference (java.lang.ref). It has over 500 instances, each one with a 'next' and 'prev' to another FinalizerReference. I know that FinalizerReference comes from objects that implement Object.finalize(), but I don't have an object in my app that implements it. How can I find out why this leak happens and fix it? 回答1: For more details about your issue, look

Possible Memory leak through FinalizerReference

不羁岁月 提交于 2019-12-30 17:22:52
问题 I have a small android app and I tried looking for memory leaks, so I clicked 'Dump Java Heap' and the first class on the list is FinalizerReference (java.lang.ref). It has over 500 instances, each one with a 'next' and 'prev' to another FinalizerReference. I know that FinalizerReference comes from objects that implement Object.finalize(), but I don't have an object in my app that implements it. How can I find out why this leak happens and fix it? 回答1: For more details about your issue, look

Dispatcher xps memory leak

余生颓废 提交于 2019-12-30 13:31:14
问题 I'm call a .net 4.0 dll from a vb6 app using com interop. In .net I create an xps document, via a xaml fixed document and save it to disk. This causes and memory leak and I've found a great solution here. Saving a FixedDocument to an XPS file causes memory leak The solution above, that worked for me, involves this line of code: Dispatcher.CurrentDispatcher.Invoke(DispatcherPriority.SystemIdle, new DispatcherOperationCallback(delegate { return null; }), null); What exactly is happening with

Strange wpf memory leak

扶醉桌前 提交于 2019-12-30 11:47:50
问题 I'm having a wierd problem with a memory leak through a MenuItem in wpf. I can observe this memory leak in .net memory profiler. Our application has the following architecture: A MainWindow which data templates an ApplicationPresenter. ApplicationPresenter lasts for the entire lifetime of the application. ApplicationPresenter has a MainPresenter which essentially represents a file and its contents. When a file (Solution) is loaded a new main presenter is created and the old one thrown away.

How to write a correct Hash Table destructor in c++

人盡茶涼 提交于 2019-12-30 11:25:06
问题 I am writing a c++ Hashtable Here is my destructor: HashMap::~HashMap() { for (int i=0; i<cap; i++) { Node* ptr = Hashtable[i]; while (ptr!=NULL) { Node* delptr; delptr=ptr; ptr=ptr->next; delete delptr; } } delete [] Hashtable; } My add function: void HashMap::add(const std::string& key, const std::string& value) { int index = hashfunction(key)%cap;; Node* ptr=Hashtable[index]; Node* newnode=new Node; if (contains(key)==false) { if (ptr == nullptr) { newnode->key=key; newnode->value=value;

XCode 5 Debug Navigator Memory disagrees with Instruments

邮差的信 提交于 2019-12-30 09:54:09
问题 I'm working on my first ARC & Core Data project, basing this stage on Xcode's (Universal) Master-Detail template. I note that Xcode5 has a memory display in the Debug Navigator but when using it find its graph bears few similarities with mem usage displayed in Instruments when running a Leaks&Allocations trace. I've done the Instruments tracing with the Simulator (simulating both iPhone & iPad - in case the 'unloading' of the detail View with the latter makes a difference) and on an iPad2 &

CrystalReports ReportDocument memory leak with database connections

偶尔善良 提交于 2019-12-30 08:30:11
问题 I've spent the past few days looking into that and I can't seem to figure it out. I have a c# WinForms application that uses the ReportDocument to load a report and put it into the Crystal Report Viewer, so that the user can preview it. The purpose is to preview different statistics and the form is never closed. There's a timer that runs and loads different reports into the viewer. While that happens the memory usage and handles (I can see them in the task manager) keep increasing. When the

Android Picasso ImageView - Out of Memory Exception MemoryLeak

落爺英雄遲暮 提交于 2019-12-30 07:15:10
问题 I am new to Android development. I'm trying to download images via HTTP and storing them inside of ImageViews or Drawables. In this example, I am using ImageViews. Initially, I used an AsyncTask to download these images (roughly ~500KB each), however I decided to use Picasso since I've read it is more reliable. In the code below, I have 20 ImageViews. Each of the image url's is an image that is roughly 400KB. However, after loading all of them, I've noticed my getUsedMem() is greater than

I need help finding my memory leak using MAT

巧了我就是萌 提交于 2019-12-30 06:26:53
问题 I'm using the MAT to compare two heap dumps. I've been taking a heap dump each day and it's growing by about 200 megs each day. I think the leak is associated with java.util.zip because of what the table shows and also because we added a new process recently that zips and unzips a lot of files. (see image) At this point I open the dominator and filtered for . Inflater . That produced a large list of java.util.zip.Inflater. Now I want to see what's holding these open so I picked one and ran

JNI Freeing Memory to Avoid Memory Leak

时光毁灭记忆、已成空白 提交于 2019-12-30 06:15:13
问题 So i have this C++ program that is called via JNI from my Java program, the code follows: JNIEXPORT jstring JNICALL Java_com_entrust_adminservices_urs_examples_authn_LdapAuthenticator2_takeInfo(JNIEnv *env, jobject obj, jstring domain, jstring id, jstring idca, jstring password) { const char *nt_domain; const char *nt_id; const char *nt_password; HANDLE hToken = 0; bool aut = false; nt_domain = env->GetStringUTFChars(domain, NULL); nt_id = env->GetStringUTFChars(id, NULL); nt_password = env-