heap-memory

Memory leak on pickle inside a for loop forcing a memory error

一曲冷凌霜 提交于 2020-07-04 03:15:25
问题 I have huge array objects that are pickled with the python pickler. I am trying to unpickle them and reading out the data in a for loop. Every time I am done reading and assesing, I delete all the references to those objects. After deletion, I even call gc.collect() along with time.sleep() to see if the heap memory reduces. The heap memory doesn't reduce pointing to the fact that, the data is still referenced somewhere within the pickle loading. After 15 datafiles(I got 250+ files to process,

How is it decided that how much physical memory is to be allocated to java heap?

对着背影说爱祢 提交于 2020-06-13 00:47:06
问题 I have machine with 16G RAM. I run a java application with arguments -Xms9G -Xmx9G . When I run top command I see that my java process is taking 13.8g VIRT , but only 4.6g of RES . PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 5019 root 20 0 13.8g 4.7g 18m S 0.7 30.7 3:28.39 java On running pmap command, I see that only ~3.9g of heap is present as RES , rest 5.7g is in virtual . Address Kbytes RSS Dirty Mode Mapping 0000000580000000 9452384 4074228 4074228 rw--- [ anon ] Upon

Set the heap start address in C program?

微笑、不失礼 提交于 2020-06-12 04:44:28
问题 Is there a way to set the heap start address in GCC compiled C program in linux? In x86_64 system,my test program sets the heap address to 4 byte referenced address ( less than FFFFFFFF). I want to set this to 8 byte referenced address for some testing ( > FFFFFFFF). Does GCC provide any way to set the heap start address? 回答1: You can do this a bit indirectly using sbrk() : #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(void) { sbrk(0xFFFFFFFF); printf("%p\n", malloc(1));

Memory usage and manipulating images

萝らか妹 提交于 2020-03-05 02:54:08
问题 TL;DR; Images converted to base64string have huge RAM footprint in large object heap. I have some code in a windows service that consumes our product images uploaded by users, standardizes them into a web-grade format (they will upload 10MB bitmaps), and does some other things like resize them into a square and add whitespace padding. It then converts them to a base64 string to upload them into our hosting environment via rest. The environment requires it be done this way, i cannot use URLS.

Does the Code Block of a method live in the stack or heap at the moment of execution?

限于喜欢 提交于 2020-02-25 02:16:05
问题 I'm relatively new to learning programming languages, and I feel I have 20 to 25% of understanding of Object Oriented Programming Language, more specifically C# language. So I really state this question without knowing the actual significance of its answer, if any, to my process of learning the language, but I really felt I need to ask it. When a method is called for execution, I know that all its local variables and its parameters and return value are actually present in the stack memory.