memory-leaks

Memory usage isn't decreasing when using free?

不问归期 提交于 2020-01-20 08:33:33
问题 Somehow this call to free() is not working. I ran this application on Windows and followed the memory using in Task Manager, but saw no reduction in memory usage after the call to free() . int main(int argc, char *argv[]) { int i=0; int *ptr; ptr = (int*) malloc(sizeof(int) * 1000); for (i=0; i < 1000; i++) { ptr[i] = 0; } free(ptr); // After this call, the program memory usage doesn't decrease system("PAUSE"); return 0; } 回答1: Typical C implementations do not return free:d memory to the

Android: Detecting leaks with Eclipse Memory Analyzer

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-20 07:20:26
问题 I have this problem Android: Screen orientation error + VM won't let us allocate x bytes so I decided to download Eclipse Memory Analyzer. I run it when my error is appearing and I have 3 problems suspects but I don't understand where it might come from. + I don't really know if my problem is due to a memory leak as the possible leaks take only 2.2;B space PROBLEM SUSPECT 1 2,094 instances of "java.lang.Class", loaded by "<system class loader>" occupy 789,200 (33.76%) bytes. Biggest instances

How can I create a reference cycle using dispatchQueues?

本秂侑毒 提交于 2020-01-19 06:09:06
问题 I feel that I've always misunderstood that when reference cycles are created. Before I use to think that almost any where that you have a block and the compiler is forcing you to write .self then it's a sign that I'm creating a reference cycle and I need to use [weak self] in . But the following setup doesn't create a reference cycle. import Foundation import PlaygroundSupport PlaygroundPage.current.needsIndefiniteExecution class UsingQueue { var property : Int = 5 var queue : DispatchQueue?

Strange leak when using QuickLook framework in iOS4.0

点点圈 提交于 2020-01-17 07:24:09
问题 I have used QuickLook framework for opening one 2 page pdf file modally, and everything works. However, after testing (Instruments Leaks) the project with different iOS versions and devices, I have noticed strange leak that was appearing when running Intruments leaks on iPhone 3GS + iOS 4.0 device. The leak was appearing after opening previewer modally on the parent view and closing previewer. Strange, but no leak was appearing when testing on simulator and iPhone 4 + iOS 5.0. I'm using Xcode

XPages: can someone shed some light on these messages?

依然范特西╮ 提交于 2020-01-17 05:39:05
问题 15/07/15 11:04: Exception Thrown Context Path: /aalto803.nsf Page Name: /Preferences.xsp javax.faces.FacesException at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:102) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96) at com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:256) at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet

How do I fix a memory leak caused by an object referenced by a ContextMenuStrip

谁说我不能喝 提交于 2020-01-17 05:36:36
问题 I have used dotMemory to locate a memory leak. The object I want gone is referenced by an event handler through a ToolStripMenuItem and ContextMenuStrip. The object contains these properties: public override ContextMenuStrip PopupMenu { get { ContextMenuStrip myPopup = new ContextMenuStrip(); myPopup.Items.Add(ItemDelete); return myPopup; } } public ToolStripMenuItem ItemDelete { get { ToolStripMenuItem itemDelete = new ToolStripMenuItem("Delete " + name); itemDelete.Enabled = Deletable;

Problem with .Net application leakage on exit

依然范特西╮ 提交于 2020-01-17 04:41:27
问题 I have machine with ws2008 x64 and .net 3.5 installed. I have a few .net applications that are run as scheduled tasks. When they exit is seems that not all memory is released. So after a few hours I get error messages with information that I do not have available memory. I tried to run really simple .net console application as scheduled task (this application only show message on console) and I got the same results. Did you have ever similar problem ? What did you do ? 来源: https:/

FileMaker's ODBC Driver doesn't release Handles (memory leak)

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-17 02:24:07
问题 After a whole day tracking down a memory leak in my VB.NET project, I have traced the cause to a bug with FileMaker's ODBC driver ! To reproduce you'll need a database you can connect to (I have mine hosted on Server Advanced 11.0.3, but you can also host it locally), and the ODBC driver registered/installed on the PC (I tested versions 11.3 and 12.0, and the latest 12.2). Start a new VB.NET WinForms project, add a button to the form and paste this code onto the button's click event: Using cn

Why does not Django release fetched db objects?

六月ゝ 毕业季﹏ 提交于 2020-01-16 15:25:00
问题 I have very simple django app: models.py: class Product(models.Model): name = models.CharField(max_length=1000, default="") desc = models.TextField(default="") views.py: from django.http import HttpResponse from models import Product def fetch(request): for p in Product.objects.all()[:300000]: pass return HttpResponse("done") I've loaded 300k sample records in MySQL database, turned debug off in settings.py and tried executed fetch view - after it completes, django still sits on 700Mb of RAM

Why does not Django release fetched db objects?

老子叫甜甜 提交于 2020-01-16 15:23:55
问题 I have very simple django app: models.py: class Product(models.Model): name = models.CharField(max_length=1000, default="") desc = models.TextField(default="") views.py: from django.http import HttpResponse from models import Product def fetch(request): for p in Product.objects.all()[:300000]: pass return HttpResponse("done") I've loaded 300k sample records in MySQL database, turned debug off in settings.py and tried executed fetch view - after it completes, django still sits on 700Mb of RAM