Check your RAM memory
Check your RAM memory
// Check all of your Linux computer's memory with this program.
// First, determine how much memory you're using.  Shut down all other
// applications you're running, aside from a command line window.  Then enter
//
// free
//
// This will give the amount of memory that's not in use in bytes.  Divide that
// number by 8, and that's the amount you should set freeMem to. On my machine,
// it came to 7.5GB.  
//
// Then compile the program and run it overnight: 
//
// gcc -std=gnu99 -O2 -o ckm -Wunused ckMem.c -lm
//
// ckm > memoryCheckOutput.txt &
//
// Let the program run for a day or so.  You can check the file it creates,
// memoryCheckOutput.txt now and again to see how it's doing.
// Any output is bad.  It will tell you on what iteration the memory failed,
// what word (remember it's using 8 byte words!) it failed on, and the value of
// the failed word.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
  const long long freeMem = 1006632960;  // 7.5 GB in 64 bit integers.
  unsigned long long *bigArray = malloc(freeMem * sizeof(long long));
  for (long long i = 0; i < freeMem; i++) { bigArray[i] = 0; }
  int ct = 0; // Count of the number of memory checks.
  while (1) {
    if ((ct % 2) == 1) {
      for (long long i = 0; i < freeMem; i++) { 
        if (bigArray[i] != 0xFFFFFFFFFFFFFFFF) {
          printf("%d) Memory != Max, %lld, at %lld.\n", ct, bigArray[i], i);
          fflush(stdout);
        }

        bigArray[i] = 0;
      }
    } else {
      for (long long i = 0; i < freeMem; i++) {
        if (bigArray[i] != 0) {
          printf("%d) Memory != 0, %lld, at %lld.\n", ct, bigArray[i], i);
          fflush(stdout);
        }

        bigArray[i] = 0xFFFFFFFFFFFFFFFF;
      }
    }
    ct++;
  }
}