Quote:
i notice the ram usage has 20MB and it is spiking to 100MB then goes to 20MB.my question is it is bad for the computer or as a program to have a regular spikes ?
No, not bad for the computer.
Without explanations of what is doing the program and how it is doing it, it is impossible to answer. the answer can be anywhere from worst design to the best design and perfectly normal to completely abnormal.
For example:
- A CDrom burner program will routinely an ISO of 800MB, it is normal.
- If you have a program that do a multiplication by using a recursive function which do a simple addition on every call would be a very bad design.
This code is doing a multiplication the worst possible way. it can call itself millions times and will take forever to complete.
long long MyRecMult(long long a, long long b) {
if (b!=0) {
long long c= MyRecMult(a, b - 1);
} else {
return 0;
}
return a + c;
}