memory-leaks

memory leak while processing large CSV

巧了我就是萌 提交于 2019-12-25 04:55:10
问题 I have a script that downloads a large product CSV file, processes the information therein (downloading images and resizing and preparing other data for database insertion), then creates another txt file of all the processed items. The problem is that it seems to be hemmoraging memory somewhere. I get an error 500 returned, but the log shows too much memory usage. I've unset as much as I can, and I'm using SPL iterators which are supposed to be less memory intensive, but i still can get to

Static Context Warning

痴心易碎 提交于 2019-12-25 04:19:23
问题 Android Studio now displays a warning when a class contains a static Context object. It says this causes a memory leak. However, I have noticed this is also done in android libraries. For instance, the LocalBroacastManager class has a static instance and it contains a context object. So how bad is this as a memory leak? I have a singleton geofencing class that runs in the background and saves a boolean to sharedPreferences indicating if the user is in the geofence or not. To save the

getInitialState() => clone(props)?

半世苍凉 提交于 2019-12-25 04:07:05
问题 We have the following React Component Hierarchy on a particular page. <Page> .... <GoogleMap> .... </GoogleMap> .... <BoxList> <Box>(lazy loaded 'n' at a time as you scroll and hit bottom, upto 400) ......(Some other box info that needs to be updated incrementally) <ItemList> <Item> (Upto 20 per Box/ItemList) ......(Some item Info that needs to be updated incrementally) </Item> <Item>...</Item> .... </ItemList> </Box> <Box>....</Box> .... </BoxList> </Page> On page load and as the user

iOS Memory management issue with ARC

*爱你&永不变心* 提交于 2019-12-25 03:53:20
问题 I've created a class called " ConnectionManager " that will handle all network request and fetch data from the server and after that call to a completion handler. ConnectionManager.h #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> #import "UIAlertView+CustomAlertView.h" #import <Crashlytics/Crashlytics.h> @interface ConnectionManager : NSObject<NSURLSessionDataDelegate> @property (weak, nonatomic) NSMutableData *receivedData; @property (weak, nonatomic) NSURL *url; @property (weak,

Memory Leak while using UIWebView Load request in IOS4.0

不羁岁月 提交于 2019-12-25 03:52:03
问题 I have a Web View Which loaded as a modal view. I am having memory leaks after loading a webpage using the following code. [myView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:30]]; My dealloc method is below: - (void)dealloc { myView.delegate = nil; [myView release]; [url release]; [super dealloc]; } Instruments showing 5 blocks of GeneralBlock 32 leaks, but no stack trace available. The leak Happens

Xcode 7.2 & Instruments memory leak not working for c++ code

半世苍凉 提交于 2019-12-25 03:39:18
问题 I use the following code: int main() { int* foo = new int[10]; foo = nullptr; sleep(60); } I build it inside XCode 7.2 and run instruments to see memory leak. I changed time delay differently and changed Instruments checking delay (from 10 to 2 sec). I tried to build project differently (Release, Debug) and also I tried to avoid compiler optimization: int* foo = new int[10]; for (int i = 0; i < 10; ++i) { foo[i] = i*3 + i^2; } for (int i = 0; i < 10; ++i) { cout << foo[i] << endl;; } foo =

Android Bitmap freeing memory - none of this works

被刻印的时光 ゝ 提交于 2019-12-25 03:36:13
问题 I get "bitmap size exceeds VM budget", eventually with my app. So I added all of these things to help alleviate the increasing memory footprint BitmapFactory.Options options = new BitmapFactory.Options(); options.inTempStorage = new byte[32*1024]; options.inDither=false; //Disable Dithering mode options.inPurgeable=true; //Tell to gc that whether it needs free memory, the Bitmap can be cleared options.inInputShareable=true; //Which kind of reference will be used to recover the Bitmap data

Memory leak, but where?

扶醉桌前 提交于 2019-12-25 03:26:10
问题 I can't understand what is leaking here using GDI = System.Drawing; public partial class MainWindow : Window { [DllImport("gdi32.dll")] private static extern bool DeleteObject(IntPtr obj); public MainWindow() { InitializeComponent(); var timer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(50) }; timer.Tick += (s, a) => { using (var bitmap = new GDI.Bitmap(1000, 1000)) { var hbitmap = bitmap.GetHbitmap(); var image = Imaging.CreateBitmapSourceFromHBitmap(hbitmap, IntPtr.Zero,

Javascript + Knockout.js memory leak - How to make sure object is being destroyed?

安稳与你 提交于 2019-12-25 02:51:57
问题 I am using google's 3 Snapshot method to find memory leaks on the page. Page is running on Knockout.js and Jquery Mobile UI. I have already narrowed down to one of memory leaking divs. Between each snapshot I am running this script to clear the memory leaking object. $('.paddedContentContainer').children().each(function(index,item){ console.log(item); $(item).off(); ko.cleanNode($(item)); $(item).remove(); item = null; }); .paddedContentContainer is parent of leaking object. Now the

Parallel.ForEach - System Out of Memory Exception

ぐ巨炮叔叔 提交于 2019-12-25 02:17:15
问题 I have a problem with my website crawler as I get System Out of Memory Exception after it crawls something around 700 URLs. Memory usage is raising from the start and in one moment program just stops. It is a console application written in C#. I think the problem is that i instantiate 6 new objects at every foreach loop. Than i pass through them, get property values with reflection and create the final object that i use to DB save. I expect .NET to destroy those object when not using them