Out of memory during "large" request

Out of memory during "large" request

am 20.11.2006 12:39:34 von juancarg

Hi.

I'm executing a query that, when I use it for the first time, I
obtain this error message;

Out of memory during "large" request for 1052672 bytes, total sbrk()
is 9917080 bytes at
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBD/Oracle .pm line 298

However, for the second time, the process works ok.
Any idea?
Thanks in advance to all.

Re: Out of memory during "large" request

am 21.11.2006 09:27:11 von juancarg

--=====================_5070421==.ALT
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Content-Transfer-Encoding: quoted-printable

At 09:25 21/11/2006, Juan Carlos Garc=EDa wrote:
>At 00:16 21/11/2006, you wrote:
>
>>post the relevant code.....including how you are going about
>>preparing, executing and fetching the data.
>
>This is my programs's code:
>
> $consulta=3Dqq{
>SELECT vista.anio_publicacion,vista.autores_lista_precios,
>=20
>vista.eci_cdu,vista.eci_bisac,vista.eci_desc_ruta,vista.lpr ecios_desc_ruta,
> vista.codigo_comercial,vista.codigo_proyecto,vista.codigo_ba rras,
> vista.comentario_lista_precios,
> vista.desc_sello_ruta_img,vista.edicion,vista.formato_encuad _paginas,
> =
vista.indice,vista.isbn,vista.iva,vista.marcar_pa_nov_rdc,vi sta.obrcod,
>=20
>TRIM(TO_CHAR(pw_utilidades_precios.f_precio_con_iva_prd(vis ta.obrcod,=20
>TO_DATE('15/11/2006')),'990D99')) precio_euros,
>=20
>TRIM(TO_CHAR(pw_utilidades_precios.f_precio_sin_iva_prd(vis ta.obrcod,=20
>TO_DATE('15/11/2006')),'990D99')) precio_euros_sin_iva,
> vista.resena,vista.resena_catalogo,vista.id_sello_editorial_ web,
>=20
>vista.subtitulo,vista.titulo,vista.titulo_str,vista.titulo_ indice,vista.tit=
ulo_indice_str,vista.orden_c,
> vista.peso,vista.complementos
>FROM extr_lprecios_v vista $tabla_cl_productos
>WHERE vista.id_sello_editorial_web =
>'$id_sello_editorial_web' $cad_query_colecciones $cad_query_listar
>ORDER BY $ordenacion};
>
> $cur21=3D $dbh->prepare($consulta);
> $cur21->execute();
> while (($anio_publicacion,$autores_lista_precios,
> $eci_cdu,$eci_bisac,$eci_desc_ruta,$lprecios_desc_ruta,
> $codigo_comercial,$codigo_proyecto,$codigo_ean,
> $comentario_lista_precios,
> $desc_sello_ruta_img,$edicion,$formato_encuad_paginas,
> $indice,$isbn,$iva,$marcar_pa_nov_rdc,$obrcod,
> $precio_euros,$precio_euros_sin_iva,
> $resena,$resena_catalogo,$id_sello_mostrar,
>=20
>$subtitulo,$titulo,$titulo_str,$titulo_indice,$titulo_indic e_str,$orden_c,
> $peso,$complementos)=3D$cur21->fetchrow)
>
>where
>
>$consulta is a variable to contain the query.
>extr_lprecios_v is the view from where I obtain the information.
>$tabla_cl_productos is a variable where I put a=20
>table name. My program build the query=20
>dynamically and sometimes I need this table.
>$cad_query_colecciones and $cad_query_listar=20
>contain the conditions for the JOIN between the=20
>view and the table in $tabla_cl_productos and=20
>some conditions to filter the regs in this last table.
>$ordenacion contains the conditions for ORDER BY sentence.
>
>Thats all. I hope that this information was useful.
>Thanks again.


--=====================_5070421==.ALT--

Re: Out of memory during "large" request

am 21.11.2006 11:23:54 von jseger

I'm very curious as to how this line evaluates. It suggests that
perhaps the query is being re-prepared with different criteria each
time through? Would it be possible to describe what's going on there
as I am thinking that (maybe) the same thing could be accomplished
through the use of placeholders.

Also, how are you processing the results? Are you shoving the whole
thing into one big array or are you processing each row and then
reusing the variables? Depending on the number of rows being
returned, shoving them all into an array can very quickly chew up all
of your available mmory.


WHERE vista.id_sello_editorial_web =3D '$id_sello_editorial_web'
$cad_query_colecciones $cad_query_listar

On 11/21/06, Juan Carlos Garc=EDa wrote:
> At 09:25 21/11/2006, Juan Carlos Garc=EDa wrote:
> >At 00:16 21/11/2006, you wrote:
> >
> >>post the relevant code.....including how you are going about
> >>preparing, executing and fetching the data.
> >
> >This is my programs's code:
> >
> > $consulta=3Dqq{
> >SELECT vista.anio_publicacion,vista.autores_lista_precios,
> >
> >vista.eci_cdu,vista.eci_bisac,vista.eci_desc_ruta,vista.lpr ecios_desc_ru=
ta,
> > vista.codigo_comercial,vista.codigo_proyecto,vista.codigo_ba rras,
> > vista.comentario_lista_precios,
> > vista.desc_sello_ruta_img,vista.edicion,vista.formato_encuad _pagina=
s,
> > vista.indice,vista.isbn,vista.iva,vista.marcar_pa_nov_rdc,vi sta.obr=
cod,
> >
> >TRIM(TO_CHAR(pw_utilidades_precios.f_precio_con_iva_prd(vis ta.obrcod,
> >TO_DATE('15/11/2006')),'990D99')) precio_euros,
> >
> >TRIM(TO_CHAR(pw_utilidades_precios.f_precio_sin_iva_prd(vis ta.obrcod,
> >TO_DATE('15/11/2006')),'990D99')) precio_euros_sin_iva,
> > vista.resena,vista.resena_catalogo,vista.id_sello_editorial_ web,
> >
> >vista.subtitulo,vista.titulo,vista.titulo_str,vista.titulo_ indice,vista.=
titulo_indice_str,vista.orden_c,
> > vista.peso,vista.complementos
> >FROM extr_lprecios_v vista $tabla_cl_productos
> >WHERE vista.id_sello_editorial_web =3D
> >'$id_sello_editorial_web' $cad_query_colecciones $cad_query_listar
> >ORDER BY $ordenacion};
> >
> > $cur21=3D $dbh->prepare($consulta);
> > $cur21->execute();
> > while (($anio_publicacion,$autores_lista_precios,
> > $eci_cdu,$eci_bisac,$eci_desc_ruta,$lprecios_desc_ruta,
> > $codigo_comercial,$codigo_proyecto,$codigo_ean,
> > $comentario_lista_precios,
> > $desc_sello_ruta_img,$edicion,$formato_encuad_paginas,
> > $indice,$isbn,$iva,$marcar_pa_nov_rdc,$obrcod,
> > $precio_euros,$precio_euros_sin_iva,
> > $resena,$resena_catalogo,$id_sello_mostrar,
> >
> >$subtitulo,$titulo,$titulo_str,$titulo_indice,$titulo_indic e_str,$orden_=
c,
> > $peso,$complementos)=3D$cur21->fetchrow)
> >
> >where
> >
> >$consulta is a variable to contain the query.
> >extr_lprecios_v is the view from where I obtain the information.
> >$tabla_cl_productos is a variable where I put a
> >table name. My program build the query
> >dynamically and sometimes I need this table.
> >$cad_query_colecciones and $cad_query_listar
> >contain the conditions for the JOIN between the
> >view and the table in $tabla_cl_productos and
> >some conditions to filter the regs in this last table.
> >$ordenacion contains the conditions for ORDER BY sentence.
> >
> >Thats all. I hope that this information was useful.
> >Thanks again.
>
>
>


--=20
------------------------------------------------------------ ---------------=
-----------------------------------
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)

They who would give up an essential liberty for temporary security,
deserve neither liberty or security.
Benjamin Franklin

Our lives begin to end the day we become silent about things that matter.
Martin Luther King

The right of the people to be secure in their persons, houses, papers,
and effects, against unreasonable searches and seizures, shall not be
violated, and no warrants shall issue, but upon probable cause,
supported by oath or affirmation, and particularly describing the
place to be searched, and the persons or things to be seized.

Amendment IV to the Constitution of the United States
------------------------------------------------------------ ---------------=
-----------------------------------

Re: Out of memory during "large" request

am 23.11.2006 13:35:10 von jseger

Juan: We can keep playing 20 questions here, or you can post the
actual code. I am not going to keep trying to guess what is happening
without seeing what's going on. Nothing that you've described so far
should cause an out of memory condition, but there are numerous spots
in what you've described that could if coded incorrectly.

On 11/23/06, Juan Carlos Garc=EDa wrote:
> At 11:23 21/11/2006, you wrote:
> Hi Jeffrey.
>
> >I'm very curious as to how this line evaluates. It suggests that
> >perhaps the query is being re-prepared with different criteria each
> >time through?
>
> Yes, it's true. My main form has some fields to select the criteria
> to extract the information.
>
> > Would it be possible to describe what's going on there
> >as I am thinking that (maybe) the same thing could be accomplished
> >through the use of placeholders.
>
> The target is to obtain a XLS file with the query's records and then,
> send it to a email direcction.
>
> >Also, how are you processing the results? Are you shoving the whole
> >thing into one big array or are you processing each row and then
> >reusing the variables?
>
> I'm processing each row independently.
>
> > Depending on the number of rows being
> >returned, shoving them all into an array can very quickly chew up all
> >of your available mmory.
>
> The number of records can range between 1 to 18000, more or less.
>
> Thanks again for your patience.
>
>


--=20
------------------------------------------------------------ ---------------=
-----------------------------------
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)

They who would give up an essential liberty for temporary security,
deserve neither liberty or security.
Benjamin Franklin

Our lives begin to end the day we become silent about things that matter.
Martin Luther King

The right of the people to be secure in their persons, houses, papers,
and effects, against unreasonable searches and seizures, shall not be
violated, and no warrants shall issue, but upon probable cause,
supported by oath or affirmation, and particularly describing the
place to be searched, and the persons or things to be seized.

Amendment IV to the Constitution of the United States
------------------------------------------------------------ ---------------=
-----------------------------------