memory-management

Does userfaultfd now support file backed map?

瘦欲@ 提交于 2021-01-01 03:56:32
问题 I saw from the documentation of userfaultfd https://manpages.debian.org/testing/manpages-dev/userfaultfd.2.en.html http://man7.org/linux/man-pages/man2/ioctl_userfaultfd.2.html that userfaultfd will start supporting shared map since kernel 4.11. However, the documentation still looks very ambiguous in the sense that I'm still wondering will these include supporting file-backed mmap (which can also be MAP_SHARED)? 回答1: To answer definitively, since the information is not in the manual page(s),

Does userfaultfd now support file backed map?

与世无争的帅哥 提交于 2021-01-01 03:55:53
问题 I saw from the documentation of userfaultfd https://manpages.debian.org/testing/manpages-dev/userfaultfd.2.en.html http://man7.org/linux/man-pages/man2/ioctl_userfaultfd.2.html that userfaultfd will start supporting shared map since kernel 4.11. However, the documentation still looks very ambiguous in the sense that I'm still wondering will these include supporting file-backed mmap (which can also be MAP_SHARED)? 回答1: To answer definitively, since the information is not in the manual page(s),

Does userfaultfd now support file backed map?

…衆ロ難τιáo~ 提交于 2021-01-01 03:51:07
问题 I saw from the documentation of userfaultfd https://manpages.debian.org/testing/manpages-dev/userfaultfd.2.en.html http://man7.org/linux/man-pages/man2/ioctl_userfaultfd.2.html that userfaultfd will start supporting shared map since kernel 4.11. However, the documentation still looks very ambiguous in the sense that I'm still wondering will these include supporting file-backed mmap (which can also be MAP_SHARED)? 回答1: To answer definitively, since the information is not in the manual page(s),

How to know a vuex state or a component size in memory

感情迁移 提交于 2020-12-29 12:59:30
问题 Is there a way to find how much size a state (object, array, etc) or a component occupies in memory. In my current context, I need that to know if a specific state/component is very heavy (in term of memory). In chrome, I already tried to snapshot the memory, but I couldn't find how to identify a specific component or state in the result in such large info like this: 来源: https://stackoverflow.com/questions/55476617/how-to-know-a-vuex-state-or-a-component-size-in-memory

How to remove / dispose a broadcast variable from heap in Spark?

人走茶凉 提交于 2020-12-28 13:20:17
问题 To broadcast a variable such that a variable occurs exactly once in memory per node on a cluster one can do: val myVarBroadcasted = sc.broadcast(myVar) then retrieve it in RDD transformations like so: myRdd.map(blar => { val myVarRetrieved = myVarBroadcasted.value // some code that uses it } .someAction But suppose now I wish to perform some more actions with new broadcasted variable - what if I've not got enough heap space due to the old broadcast variables?! I want a function like

How to remove / dispose a broadcast variable from heap in Spark?

删除回忆录丶 提交于 2020-12-28 13:19:20
问题 To broadcast a variable such that a variable occurs exactly once in memory per node on a cluster one can do: val myVarBroadcasted = sc.broadcast(myVar) then retrieve it in RDD transformations like so: myRdd.map(blar => { val myVarRetrieved = myVarBroadcasted.value // some code that uses it } .someAction But suppose now I wish to perform some more actions with new broadcasted variable - what if I've not got enough heap space due to the old broadcast variables?! I want a function like

Image in collectionView cell causing Terminated due to memory issue

拟墨画扇 提交于 2020-12-15 05:18:10
问题 I looked at several answers for this problem but none helped. vc1 is a regular vc, I grab 20 images from firebase, in vc2 I use ARKit to display those images upon user selection. I have a collectionView in vc2 that paginates 20 more images from firebase. The problem is when the next 20 images are loading and I start scrolling, the app crashes with Message from debugger: Terminated due to memory issue . When scrolling those new images, I look at the memory graph and it shoots up to 1 gig, so

Image in collectionView cell causing Terminated due to memory issue

烈酒焚心 提交于 2020-12-15 05:17:51
问题 I looked at several answers for this problem but none helped. vc1 is a regular vc, I grab 20 images from firebase, in vc2 I use ARKit to display those images upon user selection. I have a collectionView in vc2 that paginates 20 more images from firebase. The problem is when the next 20 images are loading and I start scrolling, the app crashes with Message from debugger: Terminated due to memory issue . When scrolling those new images, I look at the memory graph and it shoots up to 1 gig, so

Allocating a struct dirent without malloc()

折月煮酒 提交于 2020-12-12 11:38:47
问题 I need to use readdir_r() to read the contents of a directory in a multithreaded program. Since the size of struct dirent is filesystem dependent, man readdir_r recommends name_max = pathconf(dirpath, _PC_NAME_MAX); if (name_max == -1) /* Limit not defined, or error */ name_max = 255; /* Take a guess */ len = offsetof(struct dirent, d_name) + name_max + 1; to find the size of the allocation needed. To allocate it entryp = malloc(len); is called, and finally readdir_r() uses it like this:

High kernel memory usage in Kubernetes Node

戏子无情 提交于 2020-12-12 06:44:05
问题 I am pretty desperate searching for a solution to this. I am running a Kubernetes Cluster (v1.16.7) on AWS. Node specs are : It is an Amazon EC2 t3.medium instance with 4GB RAM and AMI: k8s-1.11-debian-stretch-amd64-hvm-ebs-2018-08-17 with kernel: 4.9.0-7-amd64 My main problem is that I see increased memory usage in the kernel, which leads to faster memory starvation issues in my node. More specifically: free -m : total used free shared buff/cache available Mem: 3895 3470 130 3 294 204 Swap: