/var getting full

Peter Maloney peter.maloney at brockmann-consult.de
Mon Apr 30 08:11:38 UTC 2012


Am 27.04.2012 17:26, schrieb Efraín Déctor:
> Thank you all.
>
> I found out that a Java process was using all this space. I restarted
> it and voilá problem solved.
Did you write this Java program?

If so, you probably need a finally block:

File f = ...
InputStream in = null;
try {
    in = new FileInputStream(in);
    //whatever you do here, such as create a Reader, you keep a
reference to the InputStream
}finally{
    //A finally is called regardless of what happens in the try. For
example, if there is an Exception thrown, the finally is run anyway.
Code at the end of the try is not called when an exception is thrown.
    if( in != null ) {
        //you must wrap this in a try{}catch(IOException){}, otherwise
the rest of your finally is not run if it throws an Exception
        try{
            in.close();
        }catch(IOException e) {
            logger.log(Level.SEVERE, Failed to close InputStream", e);
        }
    } 
}

>
>
> Thanks.
> -----Mensaje original----- From: Tom Evans
> Sent: Friday, April 27, 2012 10:22 AM
> To: Damien Fleuriot
> Cc: freebsd-stable at freebsd.org
> Subject: Re: /var getting full
>
> On Fri, Apr 27, 2012 at 4:19 PM, Damien Fleuriot <ml at my.gd> wrote:
>> Type:
>> sync
>>
>>
>> Then:
>> df -h
>>
>> Then:
>> cd /var && du -hd 1
>>
>>
>> Post results.
>>
>
> As well as this, any unlinked files that have file handles open by
> running processes will not be accounted for in du, but will be counted
> in df. You could try restarting services that write to /var.
>
> Cheers
>
> Tom
> _______________________________________________
> freebsd-stable at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscribe at freebsd.org"
> _______________________________________________
> freebsd-stable at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-stable
> To unsubscribe, send any mail to "freebsd-stable-unsubscribe at freebsd.org"



More information about the freebsd-stable mailing list