A method for managing memory in a host where virtual machines, VMs, execute, the method comprising: detecting by a virtual machine monitor, VMM, in the host that a machine physical memory page has a first value; and reclaiming the machine physical memory page by the VMM to be available for other processes in the host; installing a driver (110, 522) in a guest operating system of a virtual machine, VM,, the driver being a balloon driver (110, 522) used for communication with the VMM; operating a Java virtual machine, JVM, within the virtual machine, wherein the JVM has a memory management mechanism to manage heap memory allocated to the JVM, and a garbage collection, GC, which sweeps the heap memory and recycles dead objects; characterized by: providing a Java agent (308, 504) in the JVM which is attached to a running Java application, wherein the Java agent (308, 504) acts as a Java balloon agent (308, 504); determining, by the Java balloon agent (308, 504), an amount of the heap memory that has been reserved in the Java virtual machine, and that is in excess of heap memory currently needed by the JVM, according to a reserved amount (M2, 404) reserved in the JVM and a currently used amount (M1, 406) that is being used at a given time, the excess amount being bounded by a difference between the reserved amount (M2, 404) and the currently used amount (M1, 406); reserving a Java object in the heap memory of the JVM, by the Java balloon agent (308, 504) when instructed by the VMM via the balloon driver (110, 522), the Java object having a size equal to a size of one or more pages of memory in the host; loading the Java object with the first value, the loading being performed by the Java balloon agent (308, 504), thereby providing the machine physical memory page with the first value ready to be reclaimed by the VMM. detecting by a virtual machine monitor, VMM, in the host that a machine physical memory page has a first value; and reclaiming the machine physical memory page by the VMM to be available for other processes in the host; installing a driver (110, 522) in a guest operating system of a virtual machine, VM,, the driver being a balloon driver (110, 522) used for communication with the VMM; operating a Java virtual machine, JVM, within the virtual machine, wherein the JVM has a memory management mechanism to manage heap memory allocated to the JVM, and a garbage collection, GC, which sweeps the heap memory and recycles dead objects; providing a Java agent (308, 504) in the JVM which is attached to a running Java application, wherein the Java agent (308, 504) acts as a Java balloon agent (308, 504); determining, by the Java balloon agent (308, 504), an amount of the heap memory that has been reserved in the Java virtual machine, and that is in excess of heap memory currently needed by the JVM, according to a reserved amount (M2, 404) reserved in the JVM and a currently used amount (M1, 406) that is being used at a given time, the excess amount being bounded by a difference between the reserved amount (M2, 404) and the currently used amount (M1, 406); reserving a Java object in the heap memory of the JVM, by the Java balloon agent (308, 504) when instructed by the VMM via the balloon driver (110, 522), the Java object having a size equal to a size of one or more pages of memory in the host; loading the Java object with the first value, the loading being performed by the Java balloon agent (308, 504), thereby providing the machine physical memory page with the first value ready to be reclaimed by the VMM.