Package: netplan
Version: 1.9-3
Followup-For: Bug #334351

I wondered about the same thing, netplan size ~300MB - older netplan
took about 2MB process size.

Analysis: 
 netplan.c 270: allocate(nclients * sizeof(struct client))
 nclients=sizeof(fd_set)*8=128*8=1024
 sizeof(struct client)=262224
 NGROUPS_MAX=65536 Defined in /usr/include/linux/limits.h
 (the number of group memberships for a single uid)

 Inserting
 #define NGROUPS_MAX 16
 after line 33 (before #include "netplan.h" where struct client is defined)
 leads to a process size of ~2MB again

Comment:
 The process size is due to the int array in struct client which has
 NGROUPS_MAX entries. -DNGROUPS_MAX=16 in the Makefile does not work because 
 the include file value overrides. We could add a #if statement changing
 NGROUPS_MAX if it is higher than, say, 255, but then we could just fix
 it at 16 if we think we know better than limits.h...
 It is also not quite clear to me why nclients is not simply set to a
 count (8? 80?) but multiplied by sizeof(fd_set) - but it has apparently
 been like that for a while and worked.

Thanks for your work and best regards,
Bernd

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)

Versions of packages netplan depends on:
ii  adduser                       3.77       Add and remove users and groups
ii  libc6                         2.3.5-8    GNU C Library: Shared libraries an

netplan recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to