memory-leaks

Java memory leaks - Cleared upon program termination?

余生长醉 提交于 2019-12-20 04:59:19
问题 This seems like a yes or no question, and I would have expected it to be answered somewhere but I certainly can't find it. Memory leaks in java don't happen as often as as say developing in a language like C or C++, but they can happen. Most OS will clear memory allocated upon a program's termination, with exception to certain cases like shared memory. Is this still true for when the JVM exits? If I inadvertently create a memory leak in Java will it be cleared by either the JVM or a Linux or

Memory leak problem and i need help #1

烈酒焚心 提交于 2019-12-20 04:46:54
问题 I am very new at this and seems to have a leak in this piece of code that i cannot fix: The Instruments shows on this line with a 100%: NSMutableArray *read_Question = [[NSMutableArray alloc] initWithCapacity: 0]; I have tried all kind of things but not been able to fix it. Anyone nice that can advice me how to proceed? - (NSMutableArray *)readQuestion: (int)questionNr { NSMutableArray *read_Question = [[NSMutableArray alloc] initWithCapacity: 0]; NSError *error; //=========PREPARE CORE DATA

Leaking memory in iOS

守給你的承諾、 提交于 2019-12-20 04:28:07
问题 I ran the instruments 'Leaks' tool to test if my app has any leaks, and it showed me that I have some leaks. I'm not an expert at fixing leaks, I was wondering if I have a leak, and What I should do to fix it. 回答1: You would appear to have a leak, but it looks modest. You can click on the little arrows next to the memory address and it should take you a screen in which you can drill in and see where that memory was allocated, which is the first step in figuring out why it wasn't deallocated.

JNA Memory Leak - How to fix?

烂漫一生 提交于 2019-12-20 03:43:15
问题 public static User32 USER32_INSTANCE = (User32) Native.loadLibrary("user32", User32.class); user32 = USER32_INSTANCE; user32.EnumWindows((hWnd, arg) -> { int size = 1024 * 8; char[] buffer = new char[size]; USER32_INSTANCE.GetWindowTextW(hWnd, buffer, size); char[] buffer2 = new char[size]; PointerByReference pointer = new PointerByReference(); User32DLL.GetWindowThreadProcessId(hWnd, pointer); Pointer process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, pointer.getValue(

Rails 3.1, memory leak for missing local partial variables (Ruby 1.9.2-p290)

南楼画角 提交于 2019-12-20 03:34:37
问题 If I render a partial like so: = render :partial => "event_news_item", :object => event, :variable => true And then reference variable in the partial a memory leak is triggered. It seems rails goes into a recursion. I have to then quickly restart my server before memory usage spirals out of control. Anyone knows why the memory leak is triggered here? Can anyone confirm this on their machine? If I do = render :partial => "event_news_item", :object => event An error is raised correctly when

Rails 3.1, memory leak for missing local partial variables (Ruby 1.9.2-p290)

你说的曾经没有我的故事 提交于 2019-12-20 03:34:14
问题 If I render a partial like so: = render :partial => "event_news_item", :object => event, :variable => true And then reference variable in the partial a memory leak is triggered. It seems rails goes into a recursion. I have to then quickly restart my server before memory usage spirals out of control. Anyone knows why the memory leak is triggered here? Can anyone confirm this on their machine? If I do = render :partial => "event_news_item", :object => event An error is raised correctly when

How to Find memory leaks in Java + JNI + C++ process

谁说胖子不能爱 提交于 2019-12-20 03:23:10
问题 I have project written in java that using JNI uses a C++ library. All the code was written by us, so I have all the source code. After few hours the machine runs out of memory although my process just iterate over files and all the memory regarding the previous file deleted. I'm sure that there is a memory leak, usually I use Valgrind, but it seems he can't cope with Java very well and believes that the JVM is leaking, even for "hello world" java project. I've tested the C++ parts (the major

Memory leaks parsing XML in r

给你一囗甜甜゛ 提交于 2019-12-20 03:11:13
问题 Memory leaks when using XML package in r is not something new. This subject has already been discussed: Serious Memory Leak When Iteratively Parsing XML Files http://www.omegahat.org/RSXML/MemoryManagement.html http://r.789695.n4.nabble.com/memory-leak-using-XML-readHTMLTable-td4643332.html However, after reading all these documents, I still do not know a solution for my particular case. Consider the following code: library(XML) GetHref = function(x) { subDoc = xmlChildren(x) hrefs = ifelse

Send object from c++ to qml. What about free memory?

故事扮演 提交于 2019-12-20 03:10:10
问题 There is a model inherited from QAbstractListModel, I use it in qml. One of the properties of this model are parameters, they are specific to the element type of this model. That is one element the parameters of this class TemperatureParam, DifrentParamType another, a third still something... How can I pass an object to qml and to be sure that the memory is freed after use? The code below now works as I need to, but it seems to me that it's not safe. Param class is so trivial: class

AForge camera memory leak

天大地大妈咪最大 提交于 2019-12-20 03:04:29
问题 I'm developing an application in C#, and I developed a library that does some stuff with Aforge cameras. One of the points is to simply capture images of what is in front of the Web Cam and show it on a specific PictureBox to do so: camera.NewFrame += NewFrame; private void NewFrame(object sender, NewFrameEventArgs args) { Bitmap newFrame = new Bitmap(args.Frame); args.Frame.Dispose(); PictureBox.FromBitmapImage(newFrame); newFrame.Dispose(); newFrame = null; } What I do here, I get every