;Autor: rsts ;http://www.purebasic.fr/english/viewtopic.php?p=318713#p318713 EnableExplicit Define EventID Procedure freeWorkingMemory() Protected myProcessID,PHandle,Result myProcessID=GetCurrentProcessId_() PHandle = GetCurrentProcess_() Result= SetProcessWorkingSetSize_(PHandle,-1,-1) If Result Else ; it failed EndIf EndProcedure If OpenWindow(0,0,0,500,400,"Window",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) ButtonGadget(1,10,10,100,20,"Speicher freigeben",0) Repeat EventID=WaitWindowEvent() If EventID=#PB_Event_Gadget Select EventGadget() Case 1 freeWorkingMemory() EndSelect EndIf If EventID = #PB_Event_CloseWindow End EndIf ForEver EndIf ; IDE Options = PureBasic 5.31 (Windows - x64) ; CursorPosition = 2 ; Folding = - ; EnableUnicode ; EnableXP ; EnableUser ; EnableCompileCount = 0 ; EnableBuildCount = 0