From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,a50b9611833860a3,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.58.77 with SMTP id f13mr31655174qah.7.1367012944937; Fri, 26 Apr 2013 14:49:04 -0700 (PDT) X-Received: by 10.49.82.100 with SMTP id h4mr4072998qey.17.1367012944887; Fri, 26 Apr 2013 14:49:04 -0700 (PDT) Path: ef9ni23500qab.0!nntp.google.com!gp5no7347274qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 26 Apr 2013 14:49:04 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=62.245.124.80; posting-account=gOWpSgoAAADVGkXEvWuE0ZkuZ-N4vbqK NNTP-Posting-Host: 62.245.124.80 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: gnatcoll ORM memory leak From: landgraf Injection-Date: Fri, 26 Apr 2013 21:49:04 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2013-04-26T14:49:04-07:00 List-Id: Hi all. I'm playing with ORM in gnatcoll. Compile and run sample application [1]. And check valgrind report [2]. Did I forget call some free methods? [1] --==== main.adb ====-- with ORM; use ORM; with GNATCOLL.SQL.Sessions; use GNATCOLL.SQL.Sessions; with GNATCOLL.SQL.Sqlite; procedure Main is Session : Session_Type; begin GNATCOLL.SQL.Sessions.Setup (Descr => GNATCOLL.SQL.Sqlite.Setup ("db/gnatleak.db"), Weak_Cache => True, Max_Sessions => 9); Session := Get_new_Session; for i in 1..100 loop declare Ob : Detached_Ob'Class := New_Ob; begin Ob := New_Ob; Ob.Set_Name("myname" & I'Img); Session.Persist(Ob); end; end loop; Session.Commit; Free; end Main; --=== dbmodel ===-- |TABLE | ob | id | AUTOINCREMENT | PK ||| |name | Text |NOT NULL ||| [2] ==31208== 3,200 bytes in 100 blocks are definitely lost in loss record 56 of 57 ==31208== at 0x4C2A87C: malloc (vg_replace_malloc.c:270) ==31208== by 0x6B55BB7: __gnat_malloc (s-memory.adb:92) ==31208== by 0x6B70E41: system__pool_global__allocate (s-pooglo.adb:61) ==31208== by 0x6B810E8: system__storage_pools__subpools__allocate_any_controlled (s-stposu.adb:239) ==31208== by 0x53A1F3A: gnatcoll__sql__sessions__add_to_cache (gnatcoll-sql-sessions.adb:676) ==31208== by 0x53A29A0: gnatcoll__sql__sessions__persist (gnatcoll-sql-sessions.adb:666) ==31208== by 0x40BBD2: _ada_main (in /home/pavel/projects/gnatleak/bin/main) ==31208== by 0x40CC0B: main (in /home/pavel/projects/gnatleak/bin/main) ==31208== ==31208== LEAK SUMMARY: ==31208== definitely lost: 3,200 bytes in 100 blocks ==31208== indirectly lost: 0 bytes in 0 blocks ==31208== possibly lost: 0 bytes in 0 blocks ==31208== still reachable: 6,120 bytes in 58 blocks ==31208== suppressed: 0 bytes in 0 blocks ==31208== Reachable blocks (those to which a pointer was found) are not shown. ==31208== To see them, rerun with: --leak-check=full --show-reachable=yes ==31208==