I want to know how malloc and free work. int main() { unsigned char *p = (unsigned char*)malloc(4*sizeof(unsigned char)); memset(p,0,4); strcpy((char*)p,"abcdabcd"); // **deliberately storing 8bytes** cout << p; free(p);...
  • May 16, 2022
  • 0 Comments
I have a disk drive where the inode usage is 100% (using df -i command). However after deleting files substantially, the usage remains 100%. What’s the correct way to...
  • May 14, 2022
  • 0 Comments
How do I check if pytorch is using the GPU? It’s possible to detect with nvidia-smi if there is any activity from the GPU during the process, but I...
  • May 10, 2022
  • 0 Comments
Is there a way for a Python program to determine how much memory it’s currently using? I’ve seen discussions about memory usage for a single object, but what I...
  • May 10, 2022
  • 0 Comments