Xorg and memory. lazarus / 8-Other ---------------------------------------------------------------------- mrdebug · 2008-01-28 10:45 I wrote a simple program for linux. This is a form with a large clock with a few pictures. PC where I run it does not have the swap partition. During the day xorg consumes all free memory available. At this point, the program slows down a lot. This malfunction does not happen on a PC with memory swap. What is wrong? Sorry for my bad English. ---------------------------------------------------------------------- Ñuño_Martínez · 2008-01-28 11:55 As I understood there's nothing wrong. Your program is using a lot of memory, that's all. Try to reduce the memory needs (images needs a lot of memory) and/or add the swap partition to the system. ---------------------------------------------------------------------- mrdebug · 2008-01-30 15:26 I do not understand what happens. My program and Xorg in 5 hours use all available RAM. I attach the output of the programme. Could you help me to interpret? I do not understand the lines ./Include/customform.inc. Code: [Select] sintesi@TerminaleMaster:~/FrontEnd32$ sudo ./FrontEnd32 Heap dump by heaptrc unit 88190 memory blocks allocated : 7926782/8199304 88169 memory blocks freed     : 7925411/8197896 21 unfreed memory blocks : 1371 True heap size : 2752512 True free heap : 2749696 Should be : 2749928 Call trace for block $B73584D8 size 13   $080631FF   $080911E5  TTCPHTTPDAEMON__EXECUTE,  line 63 of UThHTTPServer.pas   $080B3737 Call trace for block $B73582F8 size 16   $0806D2FF   $080AF6C7   $082F30A2  TBLOCKSOCKET__SETLINGER,  line 2474 of blcksock.pas   $080911C3  TTCPHTTPDAEMON__EXECUTE,  line 62 of UThHTTPServer.pas   $080B3737 Call trace for block $B73582F8 size 16   $0806D2FF   $080AF6C7   $082F30A2  TBLOCKSOCKET__SETLINGER,  line 2474 of blcksock.pas   $080911C3  TTCPHTTPDAEMON__EXECUTE,  line 62 of UThHTTPServer.pas   $080B3737 Call trace for block $B73593D8 size 16   $08077158   $08077197   $080A173A  THAGGIORNADATAORA__CREATE,  line 27 of UThAggiornaDataOra.pas   $08087376  TMAINFORM__FORMCREATE,  line 337 of TFFrontEnd32.pas   $0807BCA9  TCUSTOMFORM__DOCREATE,  line 644 of ./include/customform.inc   $0807D686  TCUSTOMFORM__CREATE,  line 1364 of ./include/customform.inc   $08083E62  TAPPLICATION__CREATEFORM,  line 1607 of ./include/application.inc   $0805C31F  main,  line 19 of FrontEnd32.lpr Call trace for block $B75A8E58 size 60   $08067852   $08087376  TMAINFORM__FORMCREATE,  line 337 of TFFrontEnd32.pas   $0807BCA9  TCUSTOMFORM__DOCREATE,  line 644 of ./include/customform.inc   $0807D686  TCUSTOMFORM__CREATE,  line 1364 of ./include/customform.inc   $08083E62  TAPPLICATION__CREATEFORM,  line 1607 of ./include/application.inc   $0805C31F  main,  line 19 of FrontEnd32.lpr   $082FD66D Call trace for block $B7364A98 size 28   $08067852   $082DF5C3   $082DF36F   $0806B4A4   $082FD66D Call trace for block $B7355418 size 12   $08067852   $082DF36F   $0806B4A4   $082FD66D Call trace for block $B75A16F8 size 28   $08067852   $082B6F1C   $0806B4A4   $082FD66D sintesi@TerminaleMaster:~/FrontEnd32$ [/code] ---------------------------------------------------------------------- mrdebug · 2008-01-31 10:21 I think I have understood. The fault is xorg, it consumes increasingly ram without free as long as the program is active. How can I do to resolve this problem? ---------------------------------------------------------------------- Almindor · 2008-01-31 17:21 It's not xorg. You have a leak somewhere, as explained by the output you pasted. Look at those methods. It seems to me you're creating threads but not freeing them or something. ---------------------------------------------------------------------- Marc · 2008-02-01 10:43 not freeing threads won't hog xorg. However not freeing images will. So how are you showing your images. (last year I made a similar clock running as demoapp on some computer fair we were attending and it ran each day from 10-17 without probs)