siddheshsawant has asked for the wisdom of the Perl Monks concerning the following question:
Hello friends again...I am doing database project with help of perl and mysql. I am using DBIx and it's helping modules to perform the database operations like inserting in to database and all.Till now I was getting everything done correctly but since yesterday when I tried to run the script at the end of it's execution I used to an error like out of memory exception.The test log is as follows:
2010-03-30 10:18:35 Script started 2010-03-30 10:18:35 Date being processed: 2010_03_18 2010-03-30 10:18:35 Starting to gather data 2010-03-30 10:18:35 Gathering nightly data 2010-03-30 10:18:35 Reading data from http://some_web_site.com 2010-03-30 10:18:35 Creating an internal hash from the data 2010-03-30 12:32:10 Starting to load data into the database 2010-03-30 12:32:19 Inserting data to database
and in the output I am getting something like this :
[root@lcld0037 NightlyDB]# perl load_data_to_db.pl 2010_03_18 2010-03-30_10-18-35: Script started 2010-03-30_10-18-35: Date being processed: 2010_03_18 2010-03-30_10-18-35: Gathering nightly data . . . (287709)(562546)(562546)(562546)(562546)(562546)(275841)(476059)(47605 +9)(476059)(476059)(476059)(476059)(476059)(476059)(476059)(476059)(47 +6059)(476059)(476059)(476059)(476059)(476059)(476059)(476059)(476059) +(476059)(476059)(476059)(476059)(476059)(476059)(476059)(476059)(4760 +59)(476059)(233299)(339473)(339473)(649823)(649823)(649823)(649823)(6 +49823)(649823)(649823)(2203347)(2203347)(2203347)(2203347)(2203347)(2 +203347)(2203347)(2203347)(2203347)(2203347)(2203347)(2203347)(2203347 +)(2203347)(2203347)(2203347)(2203347)(2203347)(2203347)(2203347)(2203 +347)(2203347)(2203347)(2203347)(2203347)(2203347)(2203347)(2203347)(2 +203347)(2203347)(2095735)(2095735)(2095735)(2095735)(2095735)(2095735 +)(2095735)(2095735)(2095735)(2095735)(2095735)(2095735)(2095735)(2095 +735)(2095735)(2095735)(2095735)(2095735)(2095735)(2095735)(2095735)(2 +095735)(2095735)(2095735)(2095735)(2095735)(2095735)(2095735)(2095735 +)(2095735)(2095735)....# some random numberkeep on generating (15867513)2010-03-30_12-32-19: Inserting data to database Out of memory!
I have not changed anything in the Database Insertion script .Because the same script ran properly 2 days earlier.What is the cause of getting such exception then? Kindly tell me cause of the such exception.Also what am I supposed to do in order to get rid of such exception? Thanks in advance !!!!!
updated part of question:
I used DBIx::Class and do insertion procedure as follows in any of the table:
sub _insert_test_run { my ($self, $schema, $test_run_data) = @_; my $nightly_web_page_test_run_id = $test_run_data->{test_run_id}; my $test_controller_id = $self->_get_test_controller($schema, $test_run_data->{controll +er}); my $test_run_configuration = undef; #TO BE ADDED LATER my $start_date = $test_run_data->{start_date}; my $end_date = $test_run_data->{end_date}; my $elapsed_minutes = $test_run_data->{elapsed_minutes}; my $log_link = $test_run_data->{log_link}; my $test_run_rs = undef; eval { $test_run_rs = $schema->resultset("TestRun")->create( { nightly_web_page_test_run_id=> $nightly_web_page_test_ +run_id, test_controller_id => $test_controller_id, test_run_configuration_id => $test_run_configuration +, start_date => $start_date, end_date => $end_date, elapsed_time => $elapsed_minutes, log_link => $log_link, } ) || die "Unable to insert data to table TestRun: $!"; }; if($@) { #warn(); $self->log_writer()->write_error_row("Unable to insert data to + table TestRun: $@"); return undef; } else { return $test_run_rs; } }
In above example I am inserting in to test_run table
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: out of memory exception
by BrowserUk (Patriarch) on Mar 30, 2010 at 21:07 UTC | |
by siddheshsawant (Sexton) on Mar 30, 2010 at 21:41 UTC | |
by BrowserUk (Patriarch) on Mar 30, 2010 at 22:20 UTC | |
|
Re: out of memory exception
by Your Mother (Archbishop) on Mar 30, 2010 at 18:39 UTC | |
|
Re: out of memory exception
by roboticus (Chancellor) on Mar 30, 2010 at 20:27 UTC | |
|
Re: out of memory exception
by shmem (Chancellor) on Mar 30, 2010 at 19:08 UTC | |
by siddheshsawant (Sexton) on Mar 30, 2010 at 19:16 UTC | |
by shmem (Chancellor) on Mar 30, 2010 at 22:34 UTC | |
|
Re: out of memory exception
by nikosv (Deacon) on Mar 30, 2010 at 19:20 UTC | |
by cleverett (Friar) on Mar 30, 2010 at 19:58 UTC | |
|
Re: out of memory exception
by Your Mother (Archbishop) on Mar 30, 2010 at 21:48 UTC |