memory leak in igawk script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting memory leak in igawk script
# 1  
Old 05-26-2009
memory leak in igawk script

Hi,
We are having igawk statement calling gawk function and processing a master file, each gawk function have rules and action. We are using associative array to keep the output of each rule and finally printing the associative array. We are seeing the memory is growing incrementally in TOP command (size, res). We are deleting the associatve arrays after each pass.

igawk --re-interval -F -v OFS= -f symc.import.awk.Utils -f symc.import.cb.3eye.DSConstants -f symc.import.cb.3eye.DSUtilities -f AR_State_Master_DS1.gawk -f AR_State_Master_DS2.gawk -f Sub_Expr_Master_DS1.gawk -f corrections_Generator.gawk -f metricsGenerator.gawk -f update_Master.gawk "master.txt"

1. What are the tools I can use to find the memory leak
2. What could cause memory leak in gawk with associative array
# 2  
Old 05-26-2009
How about putting system("echo label; ps -o pid,ppid,sz,pcpu,pmem,args >> tmpfile") at intervals throughout your script, alternating the label, to identify when the process size is increasing? It may be there's a value in an associative array you've forgotten to delete, or it might be you have a bug in your version of gawk (not unheard of - I've found some versions of gawk leak memory when you use index(), but worked fine if I replaced that with a regular expression).
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Igawk vs igawk.bat

I use GNU gawk on win32 platforms and standard cmd.exe to run cmd files containing gawk commands. If I were in a unix shell I would use igawk to process "@includes" for awk "libraries" and convert them into a gawk cmd. I know you can use cygwin bash to run igawk in win32 platforms. I was just... (0 Replies)
Discussion started by: RaceQuest
0 Replies

2. Web Development

Finding Cause of Memory Leak

Hi We have just got a dedicated server with Fasthosts, O/S is Linux CentOS 6 64 bit. It was a fresh install and I have just moved one WordPress site onto there. The problem is we seem to be getting a memory leak (that's what Fasthosts said) and the database (I think) keeps crashing, so we... (3 Replies)
Discussion started by: Pokeyzx
3 Replies

3. Red Hat

Memory leak

Hi all I am using RED HAT 5.4, and i am getting memory uses problem. when i use "sync;echo 3 > /proc/sys/vm/drop_cache" command the memory will release after 2,3 hour memory show 95%. pls suggest right way. thanks (37 Replies)
Discussion started by: reply.ravi
37 Replies

4. Programming

Memory Leak

Hi, I am trying a database server which keeps a B+ plus tree structure and works on it. I am trying to find the memory used/leak while executing this process. I check the memory leak by using ps uax command. When i execute a delete query i am sure that my code frees up the existing... (9 Replies)
Discussion started by: kumaran_5555
9 Replies

5. Programming

memory leak problem

hi all Can any one plz explain me about memory leak problem Thankx (5 Replies)
Discussion started by: sonali
5 Replies

6. IP Networking

memory leak?

Hi All, my client server application can work in two modes: 1) one direction - only client sends msgs to server 2) two directions - server gives 'answers' to client. when program run in the first mode it looks OK, but when server answers to client than client's application exit its... (2 Replies)
Discussion started by: lenna
2 Replies

7. UNIX for Advanced & Expert Users

Need to create a memory leak

Hi. This might be a strange request, but does anyone have any idea on a simple shell script that would use more and more memory as it ran? Like a purposeful leak. I want to test the behaviour of an already running program when the machine runs out of memory. Thanks! (4 Replies)
Discussion started by: rebelbuttmunch
4 Replies

8. Programming

Memory LEAK with pthreads

I have this code... #include <stdio.h> #include <iostream> #include <pthread.h> static void* cliente(void *datos); int main() { pthread_attr_t tattr; int ret; size_t size = PTHREAD_STACK_MIN + 0x0100; ret = pthread_attr_init(&tattr); ret =... (8 Replies)
Discussion started by: JEscola
8 Replies

9. Programming

about virtual memory and memory leak

Hi, First of all I appreciate this group very much for its informative discussions and posts. Here is my question. I have one process whose virtual memory size increases linearly from 6MB to 12MB in 20 minutes. Does that mean my process has memory leaks? In what cases does the... (4 Replies)
Discussion started by: shriashishpatil
4 Replies
Login or Register to Ask a Question