memory-leaks

How to dispose current page in UWP

纵然是瞬间 提交于 2021-01-28 05:44:14
问题 For Example I am having 2 pages in UWP application. with the names Mainpage and HomePage. Now I am using below statement for navigating to HomePage from MainPage. Frame.Navigate(typeof(HomePage)) Now I want to dispose objects and memory of my MainPage. How Can we do that in UWP applicaiton. Please provide your suggestions to solve this issue. 回答1: You do not, the garbage collector does it for you when appropriate. 来源: https://stackoverflow.com/questions/43638188/how-to-dispose-current-page-in

Memory leak in python pandas reshuffling index

大兔子大兔子 提交于 2021-01-28 00:28:34
问题 I have a memory leak in my code, which is trying to read a csv into pandas that is too large for memory. I use chunksize to iterate, but the amount of memory in use is increasing (by the size of a chunk) for each iteration. After I interrupt the process, and clear the namespace, the python process in my task manager is still hogging n* size of chunk, with n number of iterations finished. Does anyone know which step in the loop creates something in memory that doesnt get removed? And, if so,

What is the difference between memory leak, accessing freed memory and double free?

落花浮王杯 提交于 2021-01-28 00:13:09
问题 I'm trying to figure out what is the difference between those three kinds of problems associated with memory models. If I want to simulate a memory leak scenario, I can create a pointer without calling corresponding delete method. int main() { // OK int * p = new int; delete p; // Memory leak int * q = new int; // no delete } If I want to simulate a double free scenario, I can free a pointer twice and this part memory will be assigned twice later. a = malloc(10); // 0xa04010 b = malloc(10); /

Memory profiler for Google cloud function?

匆匆过客 提交于 2021-01-27 20:49:41
问题 I'm running a Google cloud function and getting out-of-memory error: Error: memory limit exceeded. Function invocation was interrupted. However, when I profile it locally, it doesn't use more than 500-600Mb (My gcf memory allocation is 2Gb) Is there a way to have a line-by-line profiler to a) to see which steps result in highest memory increases, and b) view current memory usage of the cloud function? 回答1: This is precisely what Stackdriver Profiler is for, however Python support is currently

Extending ImageView causes memory leak

五迷三道 提交于 2021-01-27 20:20:16
问题 Good day I'm extending the ImageView class because I need it to be a square, the problem is that it seems to be causing a memory leak, because if I use the not extended ImageView class there is no output in MAT. This is the extended version, as you can see is very simple: public class SquareImageView extends ImageView { public SquareImageView(Context context) { super(context); } public SquareImageView(Context context, AttributeSet attrs) { super(context, attrs); } public SquareImageView

gRPC client do not dispose Channel

为君一笑 提交于 2021-01-27 16:08:22
问题 I'm developing .net core 2.0 application with gRPC and find out a problem: after delete reference to instance of my gRPC client class, there still channel that use resourses (memory and processor). Example code: public class MyClient : ClientBase { public MyClient(Channel channel) : base(channel) { } } internal class Program { private static void Main(string[] args) { var list = new List<MyClient>(); for (var i = 0; i < 10000; i++) { Console.WriteLine($"Creating {i} instance"); list.Add(new

gRPC client do not dispose Channel

混江龙づ霸主 提交于 2021-01-27 16:08:07
问题 I'm developing .net core 2.0 application with gRPC and find out a problem: after delete reference to instance of my gRPC client class, there still channel that use resourses (memory and processor). Example code: public class MyClient : ClientBase { public MyClient(Channel channel) : base(channel) { } } internal class Program { private static void Main(string[] args) { var list = new List<MyClient>(); for (var i = 0; i < 10000; i++) { Console.WriteLine($"Creating {i} instance"); list.Add(new

Memory leak in the empty Activity

北城余情 提交于 2021-01-27 12:45:56
问题 I recently decided to use leakcanary in my projects, So I created a project with an empty Activity just for test, When I run the app (just after project creation with no logic code or views) I got memory leak log from this library: 07-20 04:32:36.742 2967-4915/com.example.leaktest D/LeakCanary: * com.example.leaktest.MainActivity has leaked: 07-20 04:32:36.742 2967-4915/com.example.leaktest D/LeakCanary: * GC ROOT static android.app.ActivityThread.sCurrentActivityThread 07-20 04:32:36.742

valgrind --trace-children=yes reports leak despite atexit cleanup

心已入冬 提交于 2021-01-27 06:09:26
问题 I'm trying to avoid false positives with valgrind, but I'm suck with a combination of atexit() and fork() , despite using --trace-children=yes . My code: #include <stdio.h> #include <unistd.h> #include <stdlib.h> static int * arr; static void cleanup() { free(arr); printf("free arr as: %p\n", (void *)arr); } int main() { arr = malloc(16 * sizeof(int)); printf("allocated arr as: %p\n", (void *)arr); atexit(cleanup); pid_t pid = fork(); if (pid == -1) { exit(1); } else if (pid == 0) { // child

valgrind --trace-children=yes reports leak despite atexit cleanup

非 Y 不嫁゛ 提交于 2021-01-27 06:09:15
问题 I'm trying to avoid false positives with valgrind, but I'm suck with a combination of atexit() and fork() , despite using --trace-children=yes . My code: #include <stdio.h> #include <unistd.h> #include <stdlib.h> static int * arr; static void cleanup() { free(arr); printf("free arr as: %p\n", (void *)arr); } int main() { arr = malloc(16 * sizeof(int)); printf("allocated arr as: %p\n", (void *)arr); atexit(cleanup); pid_t pid = fork(); if (pid == -1) { exit(1); } else if (pid == 0) { // child