#java #memory #stack #heap #video
Год назад когда проходил собеседование на позицию разработчика во парижскую компанию, я решил задачку через реукурсию. В принципе все было просто - нужно было написать алгоритм инструмента Залить область (как в Paint).
После чего у меня спросили, а что произойдет в моем случае с программой на данных побольше: если картинка будет очень большая. О чем шла речь, как вы понимаете, я не особо понимал.
Для конекста, я учился программировать самостоятельно и какие-то темы просто даже не встречал на тот момент. Мог только уверено решать задачки и, думал, что все оке.
В общем, речь тогда шла о Stack overflow - когда ваша память выделенная на Стэк в памяти кончается.
Сегодня пересматривал эту тему еще раз, пытаясь найти очень хорошее объяснение. Перебрав много мусора, я нашел то, что хотел.
Видео ниже очень хорошо с этим справляется. Если понимате, что у вас тут пробел, или хотите просто повторить, то очень рекомендую.
https://www.youtube.com/watch?v=ckYwv4_Qtmo
Год назад когда проходил собеседование на позицию разработчика во парижскую компанию, я решил задачку через реукурсию. В принципе все было просто - нужно было написать алгоритм инструмента Залить область (как в Paint).
После чего у меня спросили, а что произойдет в моем случае с программой на данных побольше: если картинка будет очень большая. О чем шла речь, как вы понимаете, я не особо понимал.
Для конекста, я учился программировать самостоятельно и какие-то темы просто даже не встречал на тот момент. Мог только уверено решать задачки и, думал, что все оке.
В общем, речь тогда шла о Stack overflow - когда ваша память выделенная на Стэк в памяти кончается.
Сегодня пересматривал эту тему еще раз, пытаясь найти очень хорошее объяснение. Перебрав много мусора, я нашел то, что хотел.
Видео ниже очень хорошо с этим справляется. Если понимате, что у вас тут пробел, или хотите просто повторить, то очень рекомендую.
https://www.youtube.com/watch?v=ckYwv4_Qtmo
YouTube
Memory Fundamentals - part 1 of Java Memory Management
How java manages memory, explaining the stack and the heap.
#linux #memory
Very short video that helps to understand that Mem Free is not the right indicator to track memory outages:
https://www.youtube.com/watch?v=1xfzRsGAP5c
Very short video that helps to understand that Mem Free is not the right indicator to track memory outages:
https://www.youtube.com/watch?v=1xfzRsGAP5c
YouTube
Understanding Linux Memory Usage - RHCSA Tutorial
How does Linux Memory Usage work?
Get an understanding of the Linux Memory usage with this free video lesson from the "Video Course Red Hat Certified System Administrator (RHCSA) Complete Video Course: Red Hat Enterprise Linux 7".
In this course you will…
Get an understanding of the Linux Memory usage with this free video lesson from the "Video Course Red Hat Certified System Administrator (RHCSA) Complete Video Course: Red Hat Enterprise Linux 7".
In this course you will…
#lniux #memory #cache #buffers
Самое главное что я искал: "The cache is not reclaimed at the time when process get stop/exit, however when the other processes requires more memory then the free available memory, kernel will run heuristics to reclaim the memory by storing the cache data and allocating that memory to new process." 😋
Cache Pages:
A cache is the part of the memory which transparently stores data so that future requests for that data can be served faster. This memory is utilized by the kernel to cache disk data and improve i/o performance.
The Linux kernel is built in such a way that it will use as much RAM as it can to cache information from your local and remote filesystems and disks. As the time passes over various reads and writes are performed on the system, kernel tries to keep data stored in the memory for the various processes which are running on the system or the data that of relevant processes which would be used in the near future. The cache is not reclaimed at the time when process get stop/exit, however when the other processes requires more memory then the free available memory, kernel will run heuristics to reclaim the memory by storing the cache data and allocating that memory to new process.
When any kind of file/data is requested then the kernel will look for a copy of the part of the file the user is acting on, and, if no such copy exists, it will allocate one new page of cache memory and fill it with the appropriate contents read out from the disk.
The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere in the disk. When some data is requested, the cache is first checked to see whether it contains that data. The data can be retrieved more quickly from the cache than from its source origin.
SysV shared memory segments are also accounted as a cache, though they do not represent any data on the disks. One can check the size of the shared memory segments using ipcs -m command and checking the bytes column.
Buffers :
Buffers are the disk block representation of the data that is stored under the page caches. Buffers contains the metadata of the files/data which resides under the page cache. Example: When there is a request of any data which is present in the page cache, first the kernel checks the data in the buffers which contain the metadata which points to the actual files/data contained in the page caches. Once from the metadata the actual block address of the file is known, it is picked up by the kernel for processing.
https://serverfault.com/questions/23433/in-linux-what-is-the-difference-between-buffers-and-cache-reported-by-the-f
Самое главное что я искал: "The cache is not reclaimed at the time when process get stop/exit, however when the other processes requires more memory then the free available memory, kernel will run heuristics to reclaim the memory by storing the cache data and allocating that memory to new process." 😋
Cache Pages:
A cache is the part of the memory which transparently stores data so that future requests for that data can be served faster. This memory is utilized by the kernel to cache disk data and improve i/o performance.
The Linux kernel is built in such a way that it will use as much RAM as it can to cache information from your local and remote filesystems and disks. As the time passes over various reads and writes are performed on the system, kernel tries to keep data stored in the memory for the various processes which are running on the system or the data that of relevant processes which would be used in the near future. The cache is not reclaimed at the time when process get stop/exit, however when the other processes requires more memory then the free available memory, kernel will run heuristics to reclaim the memory by storing the cache data and allocating that memory to new process.
When any kind of file/data is requested then the kernel will look for a copy of the part of the file the user is acting on, and, if no such copy exists, it will allocate one new page of cache memory and fill it with the appropriate contents read out from the disk.
The data that is stored within a cache might be values that have been computed earlier or duplicates of original values that are stored elsewhere in the disk. When some data is requested, the cache is first checked to see whether it contains that data. The data can be retrieved more quickly from the cache than from its source origin.
SysV shared memory segments are also accounted as a cache, though they do not represent any data on the disks. One can check the size of the shared memory segments using ipcs -m command and checking the bytes column.
Buffers :
Buffers are the disk block representation of the data that is stored under the page caches. Buffers contains the metadata of the files/data which resides under the page cache. Example: When there is a request of any data which is present in the page cache, first the kernel checks the data in the buffers which contain the metadata which points to the actual files/data contained in the page caches. Once from the metadata the actual block address of the file is known, it is picked up by the kernel for processing.
https://serverfault.com/questions/23433/in-linux-what-is-the-difference-between-buffers-and-cache-reported-by-the-f
Server Fault
In Linux, what is the difference between "buffers" and "cache" reported by the free command?
This is an old question that I've seen from time to time. My understanding of it is rather limited (having read about the differences a long time ago, but the factoid(s) involved never really stuc...
#python #memory
Относительно простым языком написано про управление памяти в Python.
Ещё много что остаётся вне статьи, но даже прочитать только про это уже даёт чуть больше понимания что происходит с памятью.
Нужно это знать программисту/инжинеру или нет, решать тебе!
https://m.habr.com/ru/company/domclick/blog/530804/
Относительно простым языком написано про управление памяти в Python.
Ещё много что остаётся вне статьи, но даже прочитать только про это уже даёт чуть больше понимания что происходит с памятью.
Нужно это знать программисту/инжинеру или нет, решать тебе!
https://m.habr.com/ru/company/domclick/blog/530804/
Хабр
Как работает память в Python
Что такое память и зачем она нужна? Ни одна компьютерная программа не может работать без данных. А данные, чтобы программа имела к ним доступ, должны располагаться в оперативной памяти вашего...