Do you know the range of the numbers? If so, it might make sense to use an array.  For example, if I knew that the range of the numbers was between 0 and 10, I would make an array of size 10.  Each element in this array would count the number of times I've seen a given number.  Then, you just have to remember the most frequently seen number.
e.g.
array[10];
freq_index = -1;
freq_count = -1;
readVal(int n){
  array[n]+=1;
  if array[n] > freq_count
    freq_index = n;
    freq_count = array[n];
}
Of course, this approach is bad if the distribution of numbers is sparse.
I'd try a priority queue.