memory

How do non temporal instructions work?

寵の児 提交于 2020-06-11 21:17:13
问题 I'm reading What Every Programmer Should Know About Memory pdf by Ulrich Drepper. At the beginning of part 6 theres's a code fragment: #include <emmintrin.h> void setbytes(char *p, int c) { __m128i i = _mm_set_epi8(c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c); _mm_stream_si128((__m128i *)&p[0], i); _mm_stream_si128((__m128i *)&p[16], i); _mm_stream_si128((__m128i *)&p[32], i); _mm_stream_si128((__m128i *)&p[48], i); } With such a comment right below it: Assuming the pointer p is

When thread in Java is removed from memory? [duplicate]

你。 提交于 2020-06-09 18:18:59
问题 This question already has answers here : Java Thread Garbage collected or not (4 answers) Closed 5 years ago . From the Java API doc: The Java Virtual Machine continues to execute threads until following occurs: All threads that are not daemon threads have died, either by returning from the call to the run method or by throwing an exception that propagates beyond the run method. I hope my assumption is correct that once thread finishes its run() method it becomes eligible for garbage

what are pagecache, dentries, inodes?

你说的曾经没有我的故事 提交于 2020-06-09 08:44:44
问题 Just learned these 3 new techniques from https://unix.stackexchange.com/questions/87908/how-do-you-empty-the-buffers-and-cache-on-a-linux-system: To free pagecache: # echo 1 > /proc/sys/vm/drop_caches To free dentries and inodes: # echo 2 > /proc/sys/vm/drop_caches To free pagecache, dentries and inodes: # echo 3 > /proc/sys/vm/drop_caches I am trying to understand what exactly are pagecache, dentries and inodes. What exactly are they? Do freeing them up also remove the useful memcached and

Writing to persistent memory in PCIe

走远了吗. 提交于 2020-05-29 08:58:49
问题 I want to read and write to a persistant memory(for testing now ddr is connected) in my PCIe device (FPGA) on an Intel Linux system. The memory is exposed in a particular bar (say bar 2). How to access this persistant memory. I looked into examples in PMDK library, but I couldn't find any. When I looked into libpmem library I did find mapping api pmem_map_file() but there is no provision to select the bars. Is it possible to use mmap() call? Currently I am using as shown below to access my

Can an inner level of cache be write back inside an inclusive outer-level cache?

本秂侑毒 提交于 2020-05-29 07:40:07
问题 I have asked a similar question: Can a lower level cache have higher associativity and still hold inclusion? Suppose we have 2-level of cache. (L1 being nearest to CPU (inner / lower-level) and L2 being outside that, nearest to main memory) can L1 cache be write back? My attempt) I think we must have only write through cache and we cannot have write back cache in L1. If a block is replaced in the L1 cache then it has to be written back to L2 and also to main memory in order to hold inclusion.

Sparse matrix support for long vectors (over 2^31 elements)

ε祈祈猫儿з 提交于 2020-05-29 07:37:26
问题 I know this question has been asked in the past (here and here, for example), but those questions are years old and unresolved. I am wondering if any solutions have been created since then. The issue is that the Matrix package in R cannot handle long vectors (length greater than 2^31 - 1). In my case, a sparse matrix is necessary for running an XGBoost model because of memory and time constraints. The XGBoost xgb.DMatrix supports using a dgCMatrix object. However, due to the size of my data,

How to parse a zipped file completely from RAM?

柔情痞子 提交于 2020-05-29 06:01:06
问题 Background I need to parse some zip files of various types (getting some inner files content for one purpose or another, including getting their names). Some of the files are not reachable via file-path, as Android has Uri to reach them, and as sometimes the zip file is inside another zip file. With the push to use SAF, it's even less possible to use file-path in some cases. For this, we have 2 main ways to handle: ZipFile class and ZipInputStream class. The problem When we have a file-path,

Read Memory of Process C++

人走茶凉 提交于 2020-05-28 04:31:09
问题 I am trying to read a value of an address but i can't really seem to do it. I'm trying to get : client.dll + 0xA9C0DC + 0x00FC . I'm just trying to read the health of the player from a game. This is my code : #include <iostream> #include <Windows.h> #include <string> DWORD pid; DWORD Address = 0xA9C0DC; int cHealth; int main() { HWND hWnd = FindWindowA(0, ("Counter-Strike: Global Offensive")); GetWindowThreadProcessId(hWnd, &pid); HANDLE pHandle = OpenProcess(PROCESS_VM_READ, FALSE, pid);