Subject: Notification: incoming/719

From: [email-masked]
Date: Wed, 06 Jun 2001 22:34:44 -0500

FVWM Bug Tracking notification

new message incoming/719

Message summary for PR#719
	From: [email-masked]
	Subject: fvwm occupies about 10M of memory
	Date: Wed, 06 Jun 2001 22:34:19 -0500
	0 replies 	0 followups

====> ORIGINAL MESSAGE FOLLOWS <====

>From [email-masked] Wed Jun 06 22:34:44 2001
From: [email-masked]
To: [email-masked]
Subject: fvwm occupies about 10M of memory
Date: Wed, 06 Jun 2001 22:34:19 -0500

Full_Name: Andrey Panov
Version: 2.3.32
CVS_Date: 
OS: linux-2.4.5
X_Server: XFree-4.0.3
Submission from: (NULL) (62.76.7.3)

I was running fvwm-2.3.32 for 8 days and it occupied about 10Mb of memory.
This is line from top: 
14091 panov      9   0 10432 1588  1280 S       0  0.0  2.5  12:32 fvwm2
For all this time I did not run any themes, pipes and so on. I use
fixed fvwm2rc file (but create gnome and kde menus on start with PipeRead
'fvwm-menu-desktop ...').
After Restart (from its menu) fvwm occupies about 2 Mb.
It looks like a memory leak in fvwm.
My system is i386, linux-2.4.5, glibc-2.2.3, gcc-2.95.3, XFree-4.0.3.
I configured fvwm with --enable-multibyte option.

--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Thu, 7 Jun 2001 11:40:57 +0200

> I configured fvwm with --enable-multibyte option.

Note that the top output is hard to interpret and does not
necessarily mean that fvwm itself is using this much memory.  The
plain fvwm code has been tested for memory leaks very thoroughly,
so it's higly unlikely that we missed a leak this big.  On the
other hand the multibyte code is still experimental and has not
undergone extensive tests.  Please

 1) provide your config file.
 2) Send the output of "fvwm2 -version".
 3) Try to identify a any action that increases the size of fvwm2
    reported by top.

A general description of your day to day tasks (regarding fvwm)
might help to check the problem too.

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, email: [email-masked]
LifeBits Aktiengesellschaft, Albrechtstr. 9, D-72072 Tuebingen
fon: ++49 (0) 7071/7965-0, fax: ++49 (0) 7071/7965-20
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Andrey Panov <[email-masked]>
Date: Fri, 8 Jun 2001 11:36:01 +1100

> might help to check the problem too.

I use fvwm on my desctop with usual tasks:
running konqueror, kmail, knode, xterm windows, nedit, licq, qps.
I have been using fvwm with config file attached for years with small changes.
I have used fvwm 2.3 series since 2.3.19.

~$ fvwm2 -version
FVWM version 2.3.32 compiled on May 11 2001 at 13:18:41
with support for: ReadLine, XPM, GNOME WM hints, SM, Multibyte

It seems that opening of new window increases fvwm's memory size
by 10-20Kb and memory is not freed after closing of the window.

-- 
Andrey Panov
http://canopus.iacp.dvo.ru/~panov/
E-mail: [email-masked]

---

From: Dan Espen <[email-masked]>
Date: Thu, 07 Jun 2001 21:17:37 -0400

> by 10-20Kb and memory is not freed after closing of the window.

Hmm.  This is just to help collect data on this problem.

I'm using fvwm 2.3.33 from about a week ago.  I just created 11 rxvt's
with no impact on fvwm's size (not even 1K) as reported by top.

  Have ReadLine support?             yes
  Have RPlay support in FvwmEvent?   no: Can't find required librplay
  Have Stroke support?               no: Can't find required libstroke
  Have XPM support?                  yes
  Have GNOME Window Manager support? yes
  Have Session Management support?   yes
  Have GTK support for FvwmGtk?      yes
  Have GDK Imlib support in FvwmGtk? no: Failed on gdk-imlib, see config.log
  Have GNOME support in FvwmGtk?     no: Can't find working gnome-config
  Have Multibyte support?            no: This is the suggested default

-- 
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dan Espen <[email-masked]>
Date: Fri, 08 Jun 2001 09:06:56 -0400

> by 10-20Kb and memory is not freed after closing of the window.

This looks suspicious in add_window.c line 347:

static void destroy_icon_font(FvwmWindow *tmp_win)
{
  if (IS_ICON_FONT_LOADED(tmp_win) && !USING_DEFAULT_ICON_FONT(tmp_win) &&
      tmp_win->title_font.font != Scr.DefaultFont.font)
  {
    FreeFvwmFont(dpy, &(tmp_win->icon_font));
  }
  SET_ICON_FONT_LOADED(tmp_win, 0);
  /* Fall back to default font (see comment above). */
  tmp_win->icon_font = Scr.DefaultFont;
  SET_USING_DEFAULT_ICON_FONT(tmp_win, 1);
}

Try changing title_font to icon_font.
I have some work to do and can't check it myself until later.

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 8 Jun 2001 15:57:30 +0200

> I have some work to do and can't check it myself until later.

This could lead to a core dump, but I don't see how this can be a
memory leak.  Fvwm does never load fonts more than once.

Bye

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 8 Jun 2001 16:07:44 +0200

On Fri, Jun 08, 2001 at 11:36:01AM +1100, Andrey Panov wrote:
>  7 ???? 2001 20:40, ?? ????????:

Ah, I remember we discovered several memory leaks in X11.  One
is in the XGetWMNormalHints() funtion which is called once for
every new window.  Maybe it's one of those.

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Fri, 08 Jun 2001 10:16:20 -0400

> memory leak.  Fvwm does never load fonts more than once.

Using multibyte and Adrey's config file I did see  a growing fvwm2 and
Purify reported these at termination:

MLK: 24576 bytes leaked in 8 blocks
  * This memory was allocated from:
	malloc         [rtlib.o]
	_XQueryFont    [Font.c]
	XLoadQueryFont [Font.c]
	load_font      [XSunOMIF.c]
	create_fontset [XSunOMIF.c]
	create_oc      [XSunOMIF.c]
	XCreateOC      [OCWrap.c]
	XCreateFontSet [FSWrap.c]
	GetFontSetOrFixed [GetFont.c:65]
	LoadFvwmFont   [GetFont.c:106]
	setup_icon_font [add_window.c:378]
	AddWindow      [add_window.c:1307]
	HandleMapRequestKeepRaised [events.c:1035]
	HandleMapRequest [events.c:999]
	DispatchEvent  [events.c:2766]
	HandleEvents   [events.c:2819]
	main           [fvwm.c:742]
	_start         [crt1.o]
  * Block of 3072 bytes (8 times); last block at 0x324d38

I don't normally use icon titles so I might have missed them
in previous tests.  Also I'm not sure if leaks at termination
are really leaks, if you are going to exit, theres no point in
freeing things.  It does look like there were 8 icon fonts allocated.
Thats close to the number of windows I created.

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 8 Jun 2001 16:39:28 +0200

> Thats close to the number of windows I created.

You can easily verify that with the patch you suggest (already
committed).  I see the growing size too, but to a smaller extent
(with the patch, I did not try before).  Sometimes some
application seems to freak out and start to consume memory slowly,
but I could not identify which yet.  I suspect it's either
FvwmButtons (unlikely) or one of the swallowed apps (xload or
xosview).  Well, perhaps one of these is simply recording a
history in malloc'ed memory.

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Fri, 08 Jun 2001 10:56:55 -0400

Dominik Vogt <[email-masked]> writes:
> (with the patch, I did not try before).

The sizes I saw were less than the 10-20K per process reported.
I'd guess the memory lost by failing to free a font would vary
depending on the X server.

> Sometimes some

I'm only looking at the memory used by fvwm2, thats all that was
mentioned by Andrey.

---

From: Andrey Panov <[email-masked]>
Date: Sat, 9 Jun 2001 10:47:27 +1100

> every new window.  Maybe it's one of those.

I want to note that last time I used XFree-4.1.0

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 22 Jun 2001 10:28:52 +0200

> I'm only looking at the memory used by fvwm2, thats all that was

Could you set Purify to the cause and see if it helps identifying
any leaks here?

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dan Espen <[email-masked]>
Date: Fri, 22 Jun 2001 08:16:33 -0400

> Could you set Purify to the cause and see if it helps identifying

I'm not sure what you are asking for.
Would you like me to run FvwmButtons under Purify?

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 22 Jun 2001 18:25:13 +0200

> Would you like me to run FvwmButtons under Purify?

No, I mean fvwm itself.  If there is a memory leak, Purify might
be able to detect it.

Bye

Dominik ^_^  ^_^

---

From: Dan Espen <[email-masked]>
Date: Fri, 22 Jun 2001 13:55:20 -0400

> No, I mean fvwm itself.  If there is a memory leak, Purify might

Maybe I wasn't clear at the time.

I ran Purify before and after the fix was applied.
There was a leak before and the leak was gone after.