Java: Find the smallest integer not in the list - Memory Efficiency
So just a few things that I am seeing here.  You are using Math.floor, ceil on integers which is totally unnecessary, integers by definition don't have a decimal portion.  You also don't need to cast an int as an int.  

To make this run faster and take up less stack space, in the for loop where you set the bits you don't need to check anything, just do the bit twiddling you want.

int bitMod = 0x1 &lt;&lt; (number % 8);
byte b = number / 8;
bitset[b] |= bitMod;


Getting the position of the bit you want to change and then just or ing it won't change any other bits.

Finally, I don't know why you did it the way you did, but your final for loop doesn't work correctly.  It starts with the Most Significant Bit and moves down, instead of the least moving up.  Here is a version that I have tested and found to work.

for (int j=0; j&lt;8; j--) {
    if ((b &amp; (1 &lt;&lt; j)) != 0){
        location++;
    } else {
        break;
    }
}


Finally, just to see what kind of memory this might be using, I called the free memory before and after to compare the difference.  It looks like this program uses 56 MB, and takes under 100 ms after my few changes.

actual lowest is 1
(Initial Implementation)
Free Memory: 563760
Smallest number not in the list is 2
Time to execute in milliseconds: 156
2 is in the list true

(Optimized and cleaned up)
Free Memory: 563760
Smallest number not in the list is 1
Time to execute in milliseconds: 93
1 is in the list false


Here is the class I used to test.

public class TestSmallestNumberNotInList {

static final int N = 3000000;
static int[] numbers = null;
static {
    numbers = new int[N];
    for (int i = 0; i &lt; numbers.length; i++) {
        numbers[i] = Math.abs((int)(Math.round(Math.random() * N)));
    }
}

public void testFindSmallestNumberNotInList() {

    Runtime.getRuntime().gc();
    Runtime.getRuntime().gc();
    Runtime.getRuntime().gc();
    long total = Runtime.getRuntime().totalMemory();
    long free = Runtime.getRuntime().freeMemory();
    long startTime = System.currentTimeMillis();

    int byteArrayLength = (int) Math.ceil(N / 8);
    byte[] bitset = new byte[byteArrayLength];

    for (int number : numbers) {
        int byteIndex = (int)Math.floor(number / 8);
        byte b = bitset[byteIndex];
        int bitMod = (int)(number % 8);

        // The bit value will be 1 if we encountered this number before
        int bitVal = b&gt;&gt;&gt;(32-bitMod) &amp; 0x00000001;
        if (bitVal == 1)
            continue;

        //Get a byte mask to OR against the existing byte, flipping just the one bit
        //we are concerned with.
        byte byteMask = (byte)(1&lt;&lt;bitMod);
        b = (byte)(b | byteMask);

        //assign the new byte value for the byte array
        bitset[byteIndex] = b;
    }

    //Scan the byte array for the first 0 bit, this ((index * 8) + bitmodulus) is the smallest
    //integer not in the list.
    int location = 0;
    for (int i = 0; i &lt; bitset.length; i++) {
        byte b = bitset[i];
        if (b == 0xFF) {
            location += 8;
            continue;
        } else {
            for (int j=8; j&gt;=1; j--) {
                if ((b&gt;&gt;&gt;(j) &amp; 0x00000001) == 1)
                    location++;
            }
            break;
        }
    }

    long duration = System.currentTimeMillis() - startTime;

    System.out.println("Total Memory: " + (total - Runtime.getRuntime().totalMemory()));
    System.out.println("Free Memory: " + (free - Runtime.getRuntime().freeMemory()));
    System.out.println("Smallest number not in the list is " + location);
    System.out.println("Time to execute in milliseconds: " + duration);
    boolean isInList = false;
    for (int next : numbers){
        if (location == next){
            isInList = true;
            break;
        }
    }
    System.out.println(location + " is in the list " + isInList);
}

public void testMine() {
    Runtime.getRuntime().gc();
    Runtime.getRuntime().gc();
    Runtime.getRuntime().gc();
    long total = Runtime.getRuntime().totalMemory();
    long free = Runtime.getRuntime().freeMemory();
    long startTime = System.currentTimeMillis();

    int byteArrayLength = numbers.length / 8;
    byte[] bitset = new byte[byteArrayLength];

    for (int number : numbers) {
        int byteIndex = number / 8;
        int bitMod = (1 &lt;&lt; (number % 8)) &amp; 0xFF;
        bitset[byteIndex] |= bitMod;
    }

    //Scan the byte array for the first 0 bit, this ((index * 8) + bitmodulus) is the smallest
    //integer not in the list.
    int location = 0;
    for (int i = 0; i &lt; bitset.length; i++) {
        byte b = bitset[i];
        if (b == 0xFF) {
            location += 8;
            continue;
        } else {
            for (int j=0; j&lt;8; j++) {
                if ((b &amp; (1 &lt;&lt; j)) != 0){
                    location++;
                } else {
                    break;
                }
            }
            break;
        }
    }

    long duration = System.currentTimeMillis() - startTime;

    System.out.println("Total Memory: " + (total - Runtime.getRuntime().totalMemory()));
    System.out.println("Free Memory: " + (free - Runtime.getRuntime().freeMemory()));
    System.out.println("Smallest number not in the list is " + location);
    System.out.println("Time to execute in milliseconds: " + duration);

    boolean isInList = false;
    for (int next : numbers){
        if (location == next){
            isInList = true;
            break;
        }
    }
    System.out.println(location + " is in the list " + isInList);
}


public void getSmallestNotInList() {
     int lowest = 0;
     boolean notLowest = true;
     while (notLowest){
         int last = lowest;
         for (int i=0; i&lt;numbers.length; i++){
             if (numbers[i] == lowest){
                 lowest++;
                 break;
             }
         }
         if (last == lowest){
             break;
         }
     }
     System.out.println("actual lowest is " + lowest);
}
}