Javelin Programming Guidelines and Memory deallocation
Ankur
Posts: 7
I am kind of new to Javelin:
1) Whenever i compile my code with just a method in it, It gives me an error saying that the method does not denote a class method? What am i doing incorrectly?
2) For my other code i am kind of filling up the heap too fast. I know java has its own garbage collector but is there any way using which i can deallocate memory?
Please let me know-
Ankur
1) Whenever i compile my code with just a method in it, It gives me an error saying that the method does not denote a class method? What am i doing incorrectly?
2) For my other code i am kind of filling up the heap too fast. I know java has its own garbage collector but is there any way using which i can deallocate memory?
Please let me know-
Ankur
Comments
This means you should avoid using the keyword new for temporary storage.
Only local scalar variables short, int, byte and char are freed upon
return from a method. You can however use a heap if you must allocate
and free large blocks of ram space\
http://groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/peripheral/memory/
General layout of class
package package_path;
import required_files;
public class myClass {
· //constructor
· public myClass(int parameters) {
· }
· //method
· public int test(int arg) {
··· return 0;
· }
}
You must save the file in package_path with name myClass.java
Also do not use the static keyword unless there is no need for more than
one instance.
regards peter
·
I will give your class a try.
Problem is that i am trying to fill up a StringBuffer by appending it, thus i am running out of heap and the program quits on me saying out of memory. This is the first time i am doing embedded programming in JAVA. Please let me know what will be the best solution.
Other thing is if i dont include the keyword static for my methods i get an error saying it is not a class method even if i initialize it in main.
Please let me know.
Thanks.
Ankur
That way I and others can see what might be wrong.
regards peter