Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Memory exhausted: error when match() function is called with two different regexp
Hi All,

I have the following small snippet of awk code

function test(regexp)
{
match($0, regexp)
}

{
test(": ");
test("=");
}

When I execute the above small snippet of code with a big file as
input I get the following
error:

awk: /var/tmp/awk_test:4: (FILENAME=- FNR=5776) fatal: Memory
exhausted: /: /

Output of top command shows that the memory of awk process increases
gradually.
( I am executing this command in UNIX).

Any idea what is the problem ? and How to solve this?

When I tried calling the test() function with the same parameter I did
not see this error.
Also, when I commented the match() function I did not see this error.

So, It looks like their is a memory leak in match() function when it
is called with two different
regular expression. I may be wrong also.

Thanks,
Ram


Report this thread to moderator Post Follow-up to this message
Old Post
ram
08-22-07 11:57 PM


Re: Memory exhausted: error when match() function is called with two different regexp
On Aug 22, 7:42 pm, J=FCrgen Kahrs <Juergen.KahrsDELETET...@vr-web.de>
wrote:
> Which implementation of the AWK language do you use ?
> Which version ? Which Unix ?

I am seeing this memory leak in GNU Awk 3.0.6 on 6.2-RELEASE FreeBSD.

I do not see this memory leak with the same awk version on
4=2E11-RELEASE-p13 FreeBSD.

Thanks,
Ram


Report this thread to moderator Post Follow-up to this message
Old Post
ram
08-23-07 08:57 AM


Re: Memory exhausted: error when match() function is called with two different regexp
On Aug 22, 8:24 pm, Ed Morton <mor...@lsupcaemnt.com> wrote:
>
> You're probably right. I'm curious and it may provide you a workaround:
> if you don't mind trying it, what happens when you do either of these:
>
>

1) and 2) are failing with memory error and remaining steps are
working fine.

This may not be a workaround for me because I want to execute the
match()
inside a function by passing the regular exp.

Thanks,
Ram



Report this thread to moderator Post Follow-up to this message
Old Post
ram
08-23-07 08:57 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

AWK archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:58 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.