memory-leaks

How should I investigate a memory leak when using Google Cloud Datastore Python libraries?

一曲冷凌霜 提交于 2021-01-27 05:50:58
问题 I have a web application which uses Google's Datastore, and has been running out of memory after enough requests. I have narrowed this down to a Datastore query. A minimum PoC is provided below, a slightly longer version which includes memory measuring is on Github. from google.cloud import datastore from google.oauth2 import service_account def test_datastore(entity_type: str) -> list: creds = service_account.Credentials.from_service_account_file("/path/to/creds") client = datastore.Client

Memory leak when running python script from C++

我们两清 提交于 2021-01-27 03:56:28
问题 The following minimal example of calling a python function from C++ has a memory leak on my system: script.py : import tensorflow def foo(param): return "something" main.cpp : #include "python3.5/Python.h" #include <iostream> #include <string> int main() { Py_Initialize(); PyRun_SimpleString("import sys"); PyRun_SimpleString("if not hasattr(sys,'argv'): sys.argv = ['']"); PyRun_SimpleString("sys.path.append('./')"); PyObject* moduleName = PyUnicode_FromString("script"); PyObject* pModule =

Memory leak when running python script from C++

拟墨画扇 提交于 2021-01-27 03:56:28
问题 The following minimal example of calling a python function from C++ has a memory leak on my system: script.py : import tensorflow def foo(param): return "something" main.cpp : #include "python3.5/Python.h" #include <iostream> #include <string> int main() { Py_Initialize(); PyRun_SimpleString("import sys"); PyRun_SimpleString("if not hasattr(sys,'argv'): sys.argv = ['']"); PyRun_SimpleString("sys.path.append('./')"); PyObject* moduleName = PyUnicode_FromString("script"); PyObject* pModule =

Android AdMob has memory leak

大城市里の小女人 提交于 2021-01-24 21:46:17
问题 I have a BaseActivity for all activities in my app. Here I create, add to the view hierarchy and load an AdView programmatically in onStart. If I navigate to other activity in my app and then go back, or exit app LeakCanary report a memory leak. In all the examples on the internet for Admob, the ad is loaded in onCreate, but we may use onStart see this and this There is more questions about this: SO, issue BUT NOT SOLUTION. The only solution that I found is to use onStart y onStop to use all

Web Audio API Memory Leaks on Mobile Platforms

半城伤御伤魂 提交于 2021-01-17 04:07:06
问题 I am working on an application that will be using Audio quite heavily and I am in the research stages of deciding whether to use Web Audio API on devices that can support it. I have put together a very simple test bed that loads an MP3 sprite file (~600kB in size), has a play and pause button and also a destroy button, which should in theory allow GC reclaim the memory used by the Web Audio API implementation. However, after loading and destroying ~5 times iOS crashes due to an out of memory

Is it possible to monitor copy on write for forked linux processes? (specifically python)

↘锁芯ラ 提交于 2021-01-04 06:23:39
问题 I have a set of python processes that share a large object (sharing is done by forking the processes after initializing the object) I notice a strange memory leak: the process memory (VSZ and RSS) hardly change the total system memory increases steadily My guess is the shared object does change (it's 'logically' readonly, but it's possible that some internal private variables change even when just reading from it) - which causes memory pages to be copied is there a way to verify this? 回答1: To

Is it possible to monitor copy on write for forked linux processes? (specifically python)

╄→尐↘猪︶ㄣ 提交于 2021-01-04 06:19:13
问题 I have a set of python processes that share a large object (sharing is done by forking the processes after initializing the object) I notice a strange memory leak: the process memory (VSZ and RSS) hardly change the total system memory increases steadily My guess is the shared object does change (it's 'logically' readonly, but it's possible that some internal private variables change even when just reading from it) - which causes memory pages to be copied is there a way to verify this? 回答1: To

Is it possible to monitor copy on write for forked linux processes? (specifically python)

喜欢而已 提交于 2021-01-04 06:10:06
问题 I have a set of python processes that share a large object (sharing is done by forking the processes after initializing the object) I notice a strange memory leak: the process memory (VSZ and RSS) hardly change the total system memory increases steadily My guess is the shared object does change (it's 'logically' readonly, but it's possible that some internal private variables change even when just reading from it) - which causes memory pages to be copied is there a way to verify this? 回答1: To

Is it possible to monitor copy on write for forked linux processes? (specifically python)

≯℡__Kan透↙ 提交于 2021-01-04 06:09:01
问题 I have a set of python processes that share a large object (sharing is done by forking the processes after initializing the object) I notice a strange memory leak: the process memory (VSZ and RSS) hardly change the total system memory increases steadily My guess is the shared object does change (it's 'logically' readonly, but it's possible that some internal private variables change even when just reading from it) - which causes memory pages to be copied is there a way to verify this? 回答1: To

Do I need to delete objects passed to google protocol buffer (protobuf)?

谁说我不能喝 提交于 2021-01-01 06:51:16
问题 I have simple messages: message SmallValue { int32 val = 1; } message Value { int32 val1 = 1; int32 val2 = 2; SmallValue val3 = 3; } message SendMessage { int32 id = 1; oneof message { Value value= 2; } My piece of code: // create new pointer for smallValue SmallValue* smallValue = new SmallValue(); smallValue->set_val3(3); // create new object value and set_allocated_val3 Value value; value.set_val1(1); value.set_val2(2); value.set_allocated_val3(smallValue); // create new object message and