🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1469

Memory is not freed !

#1469
From: Laurent Souriau
Date: Fri, 14 Dec 2001 15:46
48 lines
2792 bytes
        Hi,

I am trying to solve the following problem :

I wrote a Java application that receives 2000 messages in 5 different
windows. Each window display the messages in its own JTextarea.

I look at memory used by javaw.exe with the Task manager.

I see that my displaying method doesn't free 7 Mbytes of memory !
However the garbage collector should free my variables .

Any clue would be welcome - Thank you

Laurent

Here is the very simple code that displays the messages :

****************************************************************************
*************
    public void addLineToReport(String line)
    {
        jtreport.append(line);  --> jtreport is a JTextarea

        if (t == t/500*500)
        {

            // Scrolling here to the current position
            int hauteur =
jtreport.getFontMetrics(jtreport.getFont()).getHeight();
            int pos = jtreport.getLineCount()* hauteur;
            int extent =
JScrollPane2.getVerticalScrollBar().getVisibleAmount();
            if (pos > extent)
            {
               // JScrollPane2.getVerticalScrollBar().setValue(pos -
8*hauteur);
               JScrollPane2.getVerticalScrollBar().setValue(pos -
4*hauteur);
            }

            jtreport.repaint();
        }

    }

****************************************************************************
*********
Technical Details
Message-ID: <9vd6nk$4e0$1@s1.read.news.oleane.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!oleane.net!oleane!nnrp.oleane.net!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,187c425c309f6a3,start
X-Google-Attributes: gid1089d0,public
X-Google-Thread: 113ae9,187c425c309f6a3,start
X-Google-Attributes: gid113ae9,public
X-Google-Thread: 10a146,187c425c309f6a3,start
X-Google-Attributes: gid10a146,public
X-Google-Thread: f74b3,187c425c309f6a3,start
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-12-14 07:45:03 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!oleane.net!oleane!nnrp.oleane.net!not-for-mail
From: "Laurent Souriau" <lsouriau@club-internet.fr>
Newsgroups: borland.public.jbuilder.java.api,borland.public.jbuilder.java.language,comp.lang.java.help,comp.lang.java.programmer
Subject: Memory is not freed !
Date: Fri, 14 Dec 2001 16:46:46 +0100
Organization: Guest of France Telecom Oleane's newsreading service
Lines: 51
Message-ID: <9vd6nk$4e0$1@s1.read.news.oleane.net>
NNTP-Posting-Host: aqsacom.rain.fr
X-Trace: s1.read.news.oleane.net 1008344628 4544 195.6.24.78 (14 Dec 2001 15:43:48 GMT)
X-Complaints-To: abuse@oleane.net
NNTP-Posting-Date: Fri, 14 Dec 2001 15:43:48 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400