Tries to free a specified amount of bytes.
If the currently available memory is enough, the method returns true without
performing additional steps. If not, the behaviour depends on the parameter force .
If false , a Full GC is only performed if former GCs indicated that a GC should
provide enough free memory. If former GCs didn't but force is set to true
a Full GC is performed nevertheless.
Setting the force parameter to false doesn't necessarily mean, that no GC may be
performed by this method, if the currently available memory doesn't suffice!
Be careful with this method as GCs should always be the last measure to take
Parameters: size - the requested amount of free memory in bytes Parameters: force - specifies whether a GC should be run even in case former GCs didn't provide enough memory whether enough memory could be freed (or is free) or not |