View Issue Details

IDProjectCategoryView StatusLast Update
0000624bareos-coredirectorpublic2016-10-13 11:55
Reportermonotek Assigned Tojoergs  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version14.04
Product Version15.2.2 
Fixed in Version15.2.4 
Summary0000624: Memory leak in bareos-dir
DescriptionI have a bareos 15.2 director on Ubuntu 14.04 using packages from the official Bareos repositorys.

After some days of successful backups my VM, which has the bareos-dir running, is running out of ram.

PS shows that bareos-dir is consuming most of the RAM. Restarting bareos-dir solves the problem for the moment but we don't like to have to do this every x days.



Steps To Reproducepid=`pgrep bareos-dir` ; for i in `seq -w 1000` ; do echo -e "list jobs\n" | bconsole > /dev/null ; echo $i ; echo "$i `ps -p $pid -o pmem=,vsz=` " >> /tmp/bareos_dir_memcount ; done

This shows increasing memory in director:
0001 1.0 719564
0002 1.0 719564
0003 1.0 719564
0004 1.0 719564
0005 1.1 727760
...
0988 1.4 746064
0989 1.4 746064
0990 1.4 754260
0991 1.4 762456
0992 1.5 770652
0993 1.5 770652
0994 1.5 770652
0995 1.5 770652
0996 1.5 778848
0997 1.5 787044
0998 1.5 795240
0999 1.5 770652
1000 1.5 770652
TagsNo tags attached.

Relationships

child of 0000641 closedmaik Release bareos-15.2.4 

Activities

monotek

monotek

2016-02-24 12:40

reporter   ~0002202

I investigated a bit further and i think i found the problem. I was wondering, why bareos-dir also consumes more ram, when there actually are no backups running.

It seems bconsole is responsible for the problem. I use it for an Icinga Monitoring check. After the last bareos-dir crash i've disabled this check and ram stays now at the same level for some hours.
maik

maik

2016-02-25 17:14

administrator   ~0002203

Could you add the Icinga Script you are using, or at least the bconsole commands? How frequently are you running the script?
monotek

monotek

2016-02-25 18:17

reporter   ~0002205

Its an Icinga check. So i think around every 5 to 10 minutes.

This is the check command i'm using:


[code]
#!/bin/bash
#
# nagios check bareos status
#

WARN="$1"
CRIT="$2"
DATE="$(date +"%Y-%m-%d")"

if [ -z $1 ]; then
    echo "Usage: $0 WARN CRIT"
    exit 3;
elif [ -z $2 ]; then
    echo "Usage: $0 WARN CRIT"
    exit 3;
fi

# mysql
#STATUS="$(mysql --defaults-file=/etc/mysql/debian.cnf -B -N -e "SELECT COUNT(*) FROM Job WHERE JobStatus != 'T' AND SchedTime LIKE '${DATE} %'" bacula)"

# postgresql
#STATUS=$(psql -t -d bareos -c "SELECT COUNT(*) FROM job WHERE jobstatus != 'T' AND schedtime::text LIKE '2016-02-24%';" | sed 's/\s//g')

# bconsole
STATUS="$(echo "list jobs" | bconsole | sed -n '10,$p' | grep -v "You have messages" | head -n -1 | grep ${DATE} | sed -e 's/.* | //g' -e 's/|//g' | grep -v T | wc -l)"

OUTPUT="STATUS=${STATUS};${WARN};${CRIT}"

if [ -z "${STATUS}" ]; then
    echo "Error - No Status found!"
    exit 3
elif [ ${STATUS} -ge ${CRIT} ]; then
    echo "CRIT - Errors = ${STATUS}|${OUTPUT}"
    exit 2
elif [ ${STATUS} -ge ${WARN} ]; then
    echo "WARN - Errors = ${STATUS}|${OUTPUT}"
    exit 1
fi

echo "Bareos run OK! Errors = ${STATUS}|${OUTPUT}"

exit 0

[/code]

i switched to the postgresql version now.
maik

maik

2016-10-13 11:55

administrator   ~0002388

Closed, release done

Related Changesets

bareos: master 44f903a3

2016-04-21 18:34

joergs


Committer: mvwieringen

Ported: N/A

Details Diff
json output: create json objects only if required

Issues 0000624: Memory leak in bareos-dir
Affected Issues
0000624
mod - src/lib/output_formatter.c Diff File

Issue History

Date Modified Username Field Change
2016-02-19 15:07 monotek New Issue
2016-02-24 12:40 monotek Note Added: 0002202
2016-02-25 17:14 maik Note Added: 0002203
2016-02-25 17:14 maik Assigned To => maik
2016-02-25 17:14 maik Status new => feedback
2016-02-25 17:15 maik Assigned To maik =>
2016-02-25 17:15 maik Status feedback => acknowledged
2016-02-25 18:17 monotek Note Added: 0002205
2016-02-29 12:08 maik Priority high => normal
2016-02-29 12:08 maik Status acknowledged => confirmed
2016-02-29 12:08 maik Product Version => 15.2.2
2016-02-29 12:08 maik Steps to Reproduce Updated
2016-04-21 16:28 joergs Assigned To => joergs
2016-04-21 16:28 joergs Status confirmed => assigned
2016-04-29 17:38 mvwieringen Changeset attached => bareos master 44f903a3
2016-06-13 14:42 joergs Status assigned => resolved
2016-06-13 14:42 joergs Fixed in Version => 15.2.4
2016-06-13 14:42 joergs Resolution open => fixed
2016-06-13 14:43 joergs Relationship added child of 0000641
2016-10-13 11:55 maik Note Added: 0002388
2016-10-13 11:55 maik Status resolved => closed