memory-management

Windows vs Linux - C++ Thread Pool Memory Usage

六眼飞鱼酱① 提交于 2020-08-27 22:27:15
问题 I have been looking at the memory usage of some C++ REST API frameworks in Windows and Linux (Debian). In particular, I have looked at these two frameworks: cpprestsdk and cpp-httplib. In both, a thread pool is created and used to service requests. I took the thread pool implementation from cpp-httplib and put it in a minimal working example below, to show the memory usage that I am observing on Windows and Linux. #include <cassert> #include <condition_variable> #include <functional> #include

Javascript memory impact of null vs undefined

半城伤御伤魂 提交于 2020-08-17 06:39:48
问题 I work in an area where memory utilization is very important to us, as we don't run on your classic web browsers / hardware. We use null quite a lot in our application, one thing that has not been clear to me is if null takes up more space than assigning a variable to undefined. Do we know if one or the other is more costly on memory usage? Thanks for help! 回答1: As you can see in this jsperf test, null seems to be slightly faster in the chrome (V8, just like nodejs) which might indicate it

Javascript memory impact of null vs undefined

旧街凉风 提交于 2020-08-17 06:39:29
问题 I work in an area where memory utilization is very important to us, as we don't run on your classic web browsers / hardware. We use null quite a lot in our application, one thing that has not been clear to me is if null takes up more space than assigning a variable to undefined. Do we know if one or the other is more costly on memory usage? Thanks for help! 回答1: As you can see in this jsperf test, null seems to be slightly faster in the chrome (V8, just like nodejs) which might indicate it

QML memory usage on big grid

邮差的信 提交于 2020-08-08 05:16:20
问题 I have a minesweeper-style game developed as a way of practicing QML. The issue I have is on the memory usage which grows quickly out of hands (>700 Mb) depending on the size of the grid. I made it sizeable up to 150*150 (bigger grid leads to crash as it's win32). The grid is built like this (with bits from Expose 2D C++ Game Board to QML using QAbstractItemModel) (the image is used to show a "bomb.png", the text to show the number of mines) : Flickable { id: flickable width: parent.width

QML memory usage on big grid

只愿长相守 提交于 2020-08-08 05:14:52
问题 I have a minesweeper-style game developed as a way of practicing QML. The issue I have is on the memory usage which grows quickly out of hands (>700 Mb) depending on the size of the grid. I made it sizeable up to 150*150 (bigger grid leads to crash as it's win32). The grid is built like this (with bits from Expose 2D C++ Game Board to QML using QAbstractItemModel) (the image is used to show a "bomb.png", the text to show the number of mines) : Flickable { id: flickable width: parent.width

Over-high memory usage during reading parquet in Python

与世无争的帅哥 提交于 2020-08-08 04:54:10
问题 I have a parquet file at around 10+GB, with columns are mainly strings. When loading it into the memory, the memory usage can peak to 110G, while after it's finished the memory usage is reduced back to around 40G. I'm working on a high-performance computer with allocated memory so I do have access to large memory. However, it seems a waste to me that I have to apply for a 128G memory just for loading data, after that 64G is sufficient for me. Also, 128G memory is more often to be out of order

Does a delegate assignment create a new copy in C#?

好久不见. 提交于 2020-08-07 06:56:42
问题 I read an article about C# and performance considerations (here) In the article, it is said that a delegate assignment triggers memory allocations, e.g: every single local variable assignment like "Func fn = Fn" creates a new instance of the delegate class Func on the heap I wanted to know if that is true, and if it is - how is that implemented? i am not familiar with any way that a reference assignment can trigger extra memory allocation in C#. 回答1: The article is right. Quite easy to test:

Is there way to verify my program has no memory leaks?

与世无争的帅哥 提交于 2020-08-04 06:50:51
问题 I wish to determine if the following program (an implementation of finding the maximum sub-array) leaks memory. Is there a general way to determine this? Such as using some feature of a debugger? What are general strategies? struct Interval { int max_left; int max_right; int sum; }; struct Interval * max_crossing_subarray(int A[], int low, int mid, int high) { struct Interval * crossing = malloc(sizeof(struct Interval)); int left_sum = INT_MIN; int sum = 0; for(int i = mid; i >= low; --i) {