TL;DR: split your items by chunck of 8 bits. Store for each chunck A the number of time you saw it before the chunck B followed by C. Then you keep track of only 2^24 counters instead of one counter by possible item. Then using some graph algorithm (the interesting part, which is not explained in the article) you can use those weighted edges to reconstruct the most frequent items with a high confidence.