Osmocom HLR for GSUP protocol towards OsmoSGSN and OsmoMSC https://osmocom.org/projects/osmo-hlr
Go to file
Vadim Yanitskiy fbd736ef37 src/db.c: integrate SQLite3 with talloc allocator
This change introduces an optional feature that allows to make
SQLite3 use talloc for all internal allocations. This would
facilitate finding memleaks. OsmoHLR needs to be configured
with '--enable-sqlite-talloc'.

  full talloc report on 'OsmoHLR' (total 292168 bytes in 449 blocks)
    struct osmo_gsup_server        contains    162 bytes in   3 blocks (ref 0)
      ...
    struct db_context              contains 288407 bytes in 420 blocks (ref 0)
      hlr.db                       contains      7 bytes in   1 blocks (ref 0)
    SQLite3                        contains 288192 bytes in 418 blocks (ref 0)
      db.c:95                      contains     48 bytes in   1 blocks (ref 0)
      db.c:95                      contains      2 bytes in   1 blocks (ref 0)
      ...

Unfortunately, old SQLite3 versions (such as 3.8.2) run out
of memory when trying to initialize a new database:

  DDB ERROR  db.c:88 (7) statement aborts at 3: []
  DDB ERROR  db.c:420 Unable to set Write-Ahead Logging: out of memory
  DDB ERROR  db.c:88 (7) statement aborts at 3: []
  DDB ERROR  db.c:238 Unable to prepare SQL statement
             'SELECT name FROM sqlite_master WHERE type='table' AND name=?'
  ...

I've noticed a huge difference in heap usage footprint compared to
generic malloc. At the same time, the recent versions (at least
3.24.0), work just fine.

Change-Id: Icfe67ed0f063b63e6794f9516da3003d01cf20a7
2019-07-30 17:15:17 +00:00
contrib contrib/jenkins.sh: run "make maintainer-clean" 2019-07-10 13:29:54 +02:00
debian debian: create -doc subpackage with pdf manuals 2019-05-29 12:14:13 +02:00
doc manuals: improve subscribers create on demand 2019-07-15 14:13:50 +02:00
include gsupclient: introduce osmo_gsup_client_enc_send() 2018-12-20 01:16:03 +07:00
sql Add IMEI column to subscriber table 2019-01-24 15:29:08 +00:00
src src/db.c: integrate SQLite3 with talloc allocator 2019-07-30 17:15:17 +00:00
tests src/db.c: integrate SQLite3 with talloc allocator 2019-07-30 17:15:17 +00:00
.gitignore gitignore: ignore everything generated in db_test 2019-07-25 12:45:55 +00:00
.gitreview Add gerrit settings 2016-12-21 10:35:38 +01:00
COPYING add COPYING file with AGPLv3 license text 2016-11-11 10:17:06 +01:00
Makefile.am Fix DISTCHECK_CONFIGURE_FLAGS override 2018-12-04 15:11:07 +00:00
configure.ac src/db.c: integrate SQLite3 with talloc allocator 2019-07-30 17:15:17 +00:00
git-version-gen build with autoconf/automake, add jenkins.sh script 2016-12-11 01:07:26 +01:00
libosmo-gsup-client.pc.in pkg-config: Fix libosmo-gsup-client pkg-config file 2018-07-31 19:37:45 +02:00