Shared library support for postmaster

Started by Erik Hofmanover 25 years ago2 messagespatches
Jump to latest
#1Erik Hofman
erik@ehofman.com

Hi,

After a little test i manneged to create a shared library for
postmaster.
Originally the postmaster program was 3922308 bytes large, but after a
small modification in src/backend/Makefile it have a postgres binary of
26812 bytes and one shared library of 3981064 bytes.

This should save 115 megabytes of memory when 32 postmaster processed
have started!!

Could anyone find a reason not to do it this way?

BTW. The modification is:

postgres: fmgr.h $(OBJS) $(VERSIONOBJ)
$(CC) -all -shared $(LDFLAGS) -o libpgback.so $(OBJS) $(OBJS1)
$(VERSIONOBJ)
$(CC) $(CFLAGS) -o postgres main/SUBSYS.o -L. $(LDFLAGS)
-lpgback

instead of:

postgres: fmgr.h $(OBJS) $(VERSIONOBJ)
$(CC) $(CFLAGS) -o postgres $(OBJS) $(OBJS1) $(VERSIONOBJ)
$(LDFLAGS)

Erik

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Erik Hofman (#1)
Re: Shared library support for postmaster

Erik Hofman <erik@ehofman.com> writes:

After a little test i manneged to create a shared library for
postmaster.
Originally the postmaster program was 3922308 bytes large, but after a
small modification in src/backend/Makefile it have a postgres binary of
26812 bytes and one shared library of 3981064 bytes.

This should save 115 megabytes of memory when 32 postmaster processed
have started!!

You wasted your time, I'm afraid. On any reasonable Unix system, all
the backends share the same copy of the text segment anyway.

regards, tom lane