Problems with memory

Hi everybody, I am building a GUI using swing, everything is ok, but some times the OutOfMemoryError() occurs. I have 256 Mb in my PC, but in my application I use a lot of components too.

Does any body know how can I manage the memory and free the space that is not in use?

Thanks in advance.

[312 byte] By [Juan27a] at [2007-9-28 14:39:13]
# 1
Just becuase your PC has 256MB does not mean java will utilise it all. You can assign more memory to various items such as the initial heap, the stack size etc.Do a search on -Xms or -Xmx and you should find what your looking for.John
jrsansoma at 2007-7-12 11:11:49 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2
Juan,That should be more than enough memory... If you wrote the code yourself, try creating an object that runs the repaint of the component in its own thread. Write a stub class that passes a component and calls the repaint method... JP
jpurduma at 2007-7-12 11:11:49 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3
Java has a default max heap size of 16MB (or so). Set the max head size using -mx128m (e.g.) on the command line. Note: This does not mean that java always uses 128MB.
jolsea at 2007-7-12 11:11:49 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 4
> Java has a default max heap size of 16MB (or so). Set> the max head size using -mx128m (e.g.) on the command> line. Note: This does not mean that java always uses> 128MB.The Sun jvm since at least 1.3 has a default heap size of 64 meg.
jschella at 2007-7-12 11:11:49 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...