#include <pwd.h>
#include <sys/resource.h>
+/** global debug value to keep track of heap memory allocation */
+void* unbound_start_brk = 0;
+
/** print usage. */
static void usage()
{
int cmdline_verbose = 0;
int debug_mode = 0;
+ /* take debug snapshot of heap */
+ unbound_start_brk = sbrk(0);
+
log_init(NULL);
/* parse the options */
while( (c=getopt(argc, argv, "c:dhv")) != -1) {
/** Size of an UDP datagram */
#define NORMAL_UDP_SIZE 512 /* bytes */
+/** give debug heap size indication */
+static void
+debug_total_mem()
+{
+ extern void* unbound_start_brk;
+ void* cur = sbrk(0);
+ int total = cur-unbound_start_brk;
+ log_info("Total heap memory estimate: %u", (unsigned)total);
+}
+
/** Report on memory usage by this thread and global */
static void
worker_mem_report(struct worker* worker)
(unsigned)mesh, (unsigned)msg, (unsigned)rrset,
(unsigned)infra, (unsigned)ac, (unsigned)superac,
(unsigned)me);
+ debug_total_mem();
}
void
struct outbound_entry* e = (struct outbound_entry*)arg;
struct worker* worker = e->qstate->env->worker;
- verbose(VERB_ALGO, "worker scvd callback for qstate %p", e->qstate);
+ verbose(VERB_ALGO, "worker svcd callback for qstate %p", e->qstate);
if(error != 0) {
mesh_report_reply(worker->env.mesh, e, 0, reply_info);
worker_mem_report(worker);
9 August 2007: Wouter
- canonicalization, signature checks
- dname signature label count and unit test.
+ - added debug heap size print to memory printout.
+ - typo fixup in worker.c
8 August 2007: Wouter
- ldns _raw routines created (in ldns trunk).