memory-leaks

memory leak with spring ConfigurableApplicationContext

ぐ巨炮叔叔 提交于 2020-01-26 02:08:05
问题 public class Tasker{ ConfigurableApplicationContext context ; public void load(){ context = = loadSpringContext(); } pulic void doSomething(){ //do something } public void close(){ context.close(); } } public class Caller extends Thread { public void run(){ Tasker tasker = new Tasker(); try{ tasker.load(); tasker.doSomething(); }finally(){ tasket.close(); } } } //sample driver code which is not in my control Caller caller = new Caller() caller.start(); caller.stop(); Now the problem is if

reliability of proc/statm for finding memory leak

巧了我就是萌 提交于 2020-01-26 01:44:42
问题 I am trying to find a slow memory leak in a large application. ps shows the VSZ growing slowly until the application crashes after running for 12-18 hours. Unfortunately, valgrind, leakcheak, etc have not been useful (Valgrind fails with illegal instruction). Alternatively, I've been printing the contents of /proc/statm over time, and approximately every 10s I see the first field of statm (total program size) increase by 20-30 bytes. I've tracked it down to one function but it doesn't make

Many leaks showing in Instruments caused by Array and Dictionary

和自甴很熟 提交于 2020-01-25 19:00:27
问题 I was testing my app using Instruments checking for any leaks and to my surprise it's showing many leaks caused mainly by: _ContiguousArrayStorage<String> _ContiguousArrayStorage<Int> _ContiguousArrayStorage<NSLayoutConstraint> _NativeDictionaryStorageOwner<Int, CGFloat> _NativeDictionaryStorageOwner<String, AnyObject> The tests are done on an iPhone 5s, iPhone 6s and iPad Pro. All of the devices are running iOS 10. What can I do about these leaks? 来源: https://stackoverflow.com/questions

Python matplotlib memory clog (not clearing)

点点圈 提交于 2020-01-25 13:06:10
问题 I have a problem with matplotlib not clearing memory (I assume). I've tried looking around on Google but to no avail. I'd like the memory to clear each time after I close matplotlib figure (which is invoked by "PLOT" button). Thanks in advance. ################ #IMPORT MODULES# ################ from Tkinter import * import matplotlib.pyplot as plt ##### #GUI# ##### class Application(Frame): #read entry values and estimate the plot(s) def run_brussel(self): #read entry values t_start = float

Does this implementation of the Entity Framework leaks memory?

霸气de小男生 提交于 2020-01-25 12:23:34
问题 I just can't make out if the entity context is disposed in the usage flow when used in a using statement in a web application or a console application. Thanks! using System; using System.Web; namespace Foo.Model { public partial class FooEntities : ObjectContext { private const string CurrentContextKey = "FooEntities.Current"; [ThreadStatic] private static FooEntities _currentOnThreadStatic; private FooEntities _previousContext; /// <summary> /// Gets the current <see cref="FooEntities"/>

Memory is not released during perform batch updates in CollectionView

£可爱£侵袭症+ 提交于 2020-01-25 09:06:01
问题 I've been working on a project of using two UICollectionView 's I have on that is the MainViewController with full screen cells that scroll horizontally and one that sits on that full screen cell and scrolls vertically. I have a functionality that adds as well as deletes cells. When a user taps and one of the pages of the MainViewController is deleted using the code below the memory that grew as cells were added is still being retained. Is there something Im doing wrong. All of my delegates

Memory is not released during perform batch updates in CollectionView

你说的曾经没有我的故事 提交于 2020-01-25 09:05:30
问题 I've been working on a project of using two UICollectionView 's I have on that is the MainViewController with full screen cells that scroll horizontally and one that sits on that full screen cell and scrolls vertically. I have a functionality that adds as well as deletes cells. When a user taps and one of the pages of the MainViewController is deleted using the code below the memory that grew as cells were added is still being retained. Is there something Im doing wrong. All of my delegates

Need help fixing memory leak - NSMutableString

对着背影说爱祢 提交于 2020-01-25 08:05:06
问题 Have been playing around with instruments with not much luck in figuring out how to solve this memory leak. Firstly the code: -(NSString *) randomizeHint:(NSString *) wordToShuffle{ NSMutableString * outputstring = [NSMutableString stringWithCapacity:[wordToShuffle length]]; NSMutableSet * usedNumberSet = [NSMutableSet setWithCapacity:[wordToShuffle length]]; for (int i=0; i<[wordToShuffle length]; i++) { int randomnum = arc4random()%[wordToShuffle length]; while ([usedNumberSet

NSArray sortedArrayUsingSelector memory leak

夙愿已清 提交于 2020-01-24 14:02:53
问题 I receive a memory leak for the line containing the sortedArrayUsingSelector definition. Does anybody know what might be the problem? @property (nonatomic, retain) NSArray *indexLetters; ... NSMutableDictionary *indexedCategories = [[NSMutableDictionary alloc] init]; ... self.indexLetters = [[indexedCategories allKeys] sortedArrayUsingSelector:@selector(compare:)]; [indexedCategories release]; 回答1: It could be because you're not releasing the indexLetters variable in dealloc . 来源: https:/

C++ destructor memory leak

Deadly 提交于 2020-01-24 13:05:05
问题 Relatively simple question about handling destructors properly... First I've got a class that's something like this: class Foo { public: ReleaseObjects() { for (std::map<size_t, Object*>::iterator iter = objects.begin(); iter != objects.end(); iter++) { delete (*iter).second; } objects.clear(); } private: std::map<size_t,Object*> objects; } So the function simply deletes the objects, which were created using 'new'. Problem is an Object class: class Bar : public Object { public: Bar() { baz =