Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Dec 2017 17:49:53 +0100
From:      Wolfram Schneider <wosch@freebsd.org>
To:        Konstantin Belousov <kostikbel@gmail.com>, Wolfram Schneider <wosch@freebsd.org>
Cc:        David Wolfskill <david@catwhisker.org>, freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: /usr/obj is 11GB huge on FreeBSD 12-current
Message-ID:  <CAMWY7CABjdO%2BsKetQs%2BBGb4jZan%2Bh_JzMNH8q07uc2KvxSQ-uQ@mail.gmail.com>
In-Reply-To: <CAMWY7CBEd5hv5PNDe_=acxLXsBUw56b=u=%2BH%2BAGxFUD2XCfXmA@mail.gmail.com>
References:  <CAMWY7CDoF9LWJiz1wB7XWUtKsvk6QJGvH=yrUCh9FnRoG4y7EA@mail.gmail.com> <20171215120243.GB1179@albert.catwhisker.org> <CAMWY7CCWZ8RkprECMnPsAJy-3vfzdy50u0Zq4BGyCexKoEan%2Bg@mail.gmail.com> <CAMWY7CCOWmDzfPEZNTdxNCPO8JA46h98GrJPBd11un6Pn%2BaFhg@mail.gmail.com> <20171215183928.GO2272@kib.kiev.ua> <CAMWY7CBEd5hv5PNDe_=acxLXsBUw56b=u=%2BH%2BAGxFUD2XCfXmA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 15 December 2017 at 20:20, Wolfram Schneider <wosch@freebsd.org> wrote:
> On 15 December 2017 at 19:39, Konstantin Belousov <kostikbel@gmail.com> wrote:
>> On Fri, Dec 15, 2017 at 06:38:48PM +0100, Wolfram Schneider wrote:
>>> On 15 December 2017 at 17:51, Wolfram Schneider <wosch@freebsd.org> wrote:
>>> > On 15 December 2017 at 13:02, David Wolfskill <david@catwhisker.org> wrote:
>>> >> On Fri, Dec 15, 2017 at 10:12:09AM +0100, Wolfram Schneider wrote:
>>> >>> Hi,
>>> >>>
>>> >>> I upgraded a machine from 11-stable to 12-current. The /usr/obj tree
>>> >>> is now 11GB huge:
>>> >>>
>>> >>> FreeBSD 12-current
>>> >>> $ du -hs /usr/obj
>>> >>>  11G /usr/obj
>>> >>>
>>> >>> on FreeBSD 11-stable it was less the size:
>>> >>> $ du -hs /usr/obj
>>> >>> 5.6G /usr/obj
>>> >>>
>>> >>> this is a problem when you have a small VM with 20GB disk space or less.
>>> >>>
>>> >>> Is there a way to use less /usr/obj disk space during build? I know
>>> >>> that we have to do some bootstrapping for newer compiler tools, but
>>> >>> does we need to keep all temp files during the build?
>>> >>
>>> >> There was a change near the beginning of November; please see UPDATING
>>> >> entry 20171101 -- you probably have several no-longer-used
>>> >> subdirectories under /usr/obj/usr/src/.
>>> >>
>>> >> Once those are cleared out, my experience (tracking stable/11 & head in
>>> >> different slices on the same machines) is that stbale/11 is using about
>>> >> 5.0G, while head uses about 6.1G.
>>> >
>>> > I think the suspect directories are "tmp" and "obj-lib32", together
>>> > they are 4.1GB huge.
>>> >
>>> > I will run a build of current again with a clean obj tree (-current on
>>> > a recent -current). Let's see.
>>>
>>> I run a test on universe12b (FreeBSD 12.0-CURRENT #0 r325426: Sun Nov
>>> 5) with an empty obj directory.
>>>
>>> `make buildworld' creates 9.7GB of obj data. After running `make
>>> buildkernel' it will grow to 12GB. This is on a ZFS filesystem (my
>>> original report was on UFS)
>>
>> Most likely reason of the bump is generation of debugging data, turned on
>> for 12.  Another not usable thing to disable are tests and profile libraries.
>> Put the following into /etc/src.conf:
>> WITHOUT_PROFILE=yes
>> WITHOUT_DEBUG_FILES=yes
>> WITHOUT_TESTS=yes
>
> Hi Konstantin,
>
> I tried these 3 variables and the results looks much better, down to
> 5.1GB from 12GB. Many thanks!
>
> $ du -hs obj*
>  12G obj-debug
> 5.1G obj-nodebug

I did another test which of the WITHOUT_* variables saves most of the space

5.5G obj-WITHOUT_DEBUG_FILES (6.5GB less)
 10G obj-WITHOUT_LIB32 (2GB less)
 11G obj-WITHOUT_PROFILE (1GB less)
 12G obj-WITHOUT_TESTS

if you are short on disk space (e.g. a small VM with SSD drive), you
should compile with
$ export WITHOUT_DEBUG_FILES=YES; make buildworld

-Wolfram

-- 
Wolfram Schneider <wosch@FreeBSD.org> https://wolfram.schneider.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMWY7CABjdO%2BsKetQs%2BBGb4jZan%2Bh_JzMNH8q07uc2KvxSQ-uQ>