Alright, I think I see your problem.
Processo filaDeProcesso[] = new Processo[numeroDeProcessos];
This is executed at the moment you create a ContadorDeProcessos object. That happens in the first line of this method:
public void analisarTamanho() throws Exception {
ContadorDeProcessos contadorNUmero = new ContadorDeProcessos(); //RIGHT HERE. That means that here your array is set to a length of 0
BufferedReader analisador = new BufferedReader(new FileReader("process.txt"));
while (analisador.readLine() != null) {
numeroDeProcessos++;
}
System.out.println("NUMERO DE PROCESSO" + numeroDeProcessos);
contadorNUmero.setNumero(numeroDeProcessos);
System.out.println("TESTE" + contadorNUmero.getNumero());
contadorNUmero.numero = numeroDeProcessos;
analisador.close();
}
that means your "contadorNUmero" object now has an array with the length 0.
First of all. Is there a reason why ContadorDeProcessos extends Leitor? I don't think you should do that, because ContadorDeProcessos doesn't really have anything to do with the Leitor class (Which I assume means Reader. If you don't understand what inheritance is normally used for then I can explain you that if you want).
Next you should be using a Constructor in ContadorDeProcessos, like this:
public class ContadorDeProcessos {
Leitor leitor = new Leitor();
int numero;
Processo filaDeProcesso[];
//This is the Constructor. This is called whenever you write "new ContadorDeProcessos(someInteger);"
public ContadorDeProcessos(int numero){
this.numero = numero;
filaDeProcesso[] = new Processo[numero]; //Now the array has the size of numeroDeProcessos
]
public int getNumero() {
return numero;
}
public void setNumero(int numero) {
this.numero = numero;
}
public void vernumero() {
System.out.println(numero);
}
public void setProcessoNaFila(Processo process, int num) {
filaDeProcesso[num] = process;
}
}
Next in your Leitor code:
public class Leitor {
int numeroDeProcessos = 0;
int contadorDeprocesso = 0;
Escalonador escalonador = new Escalonador();
public void analisarTamanho() throws Exception {
BufferedReader analisador = new BufferedReader(new FileReader("process.txt"));
while (analisador.readLine() != null) {
numeroDeProcessos++;
}
ContadorDeProcessos contadorNUmero = new ContadorDeProcessos(numeroDeProcessos); //Here numeroDeProcessos has the correct value and will now pass this value to the contadorNUmero object. This line will call the Constructor of ContadorDeProcessos
System.out.println("NUMERO DE PROCESSO" + numeroDeProcessos);
System.out.println("TESTE" + contadorNUmero.getNumero());
analisador.close();
}
Now everything should happen in the right order and your array should have the right size.
Edit: The reason why it did not work before is because your array was created while numeroDeProcessos was still 0. Even if you change numeroDeProcessos afterwards, your array size stays the same once it is created. You just had to create the array once numeroDeProcessos had the right value. That was the mistake.
At 1.65V you should be able to get at least 2000MHz, although you should be able to get higher. Just be sure to check the stability of the RAM at the speed and voltages.
I don't recommend overclocking RAM. The performance gains are so small that it won't make a difference whether you OC it or not.
However, if you insist on OCing it, use memtest86 to test stability.
Also, I'd just like to politely point out that it isn't necessary to make your post in red font, as it violates the LTT CoC.