pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
jdbc high memory consumption for RAISE NOTICE output using function-call in Java
3+ messages / 3 participants
[nested] [flat]

* jdbc high memory consumption for RAISE NOTICE output using function-call in Java
@ 2015-12-08 10:37  Georg Brünsing <georg.bruensing@clickware.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Georg Brünsing @ 2015-12-08 10:37 UTC (permalink / raw)
  To: pgsql-jdbc

The function creates ~16MB output. The VM needs ~200MB over 
statement.executeQuery(...).

CREATE OR REPLACE FUNCTION Test_Grosse_Logdatei() returns INTEGER AS
$$
DECLARE
BEGIN
     FOR i IN 1..150000 LOOP
         RAISE notice '123456789 123456789 123456789 123456789 123456789 
123456789 123456789 123456789 123456789 123456789 ';
     END LOOP;

     RETURN 0;
END;
$$
language plpgsql;

How can we reduce this?

Georg Brünsing

postgresql-9.4-1206-jdbc4.jar + postgresql-9.1-902.jdbc4.jar
psql (PostgreSQL) 9.3.1
Java(TM) SE Runtime Environment (build 1.8.0_66-b18) + Java(TM) SE 
Runtime Environment (build 1.7.0_75-b13) + Java(TM) SE Runtime 
Environment (build pxa6460sr7-20091215_02(SR7))
JDK 6-8
Windows/Linux

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: jdbc high memory consumption for RAISE NOTICE output using function-call in Java
@ 2015-12-08 12:02  Daniel Blanch Bataller <dblanch@hoplasoftware.com>
  parent: Georg Brünsing <georg.bruensing@clickware.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Daniel Blanch Bataller @ 2015-12-08 12:02 UTC (permalink / raw)
  To: Georg Brünsing <georg.bruensing@clickware.de>; +Cc: pgsql-jdbc

Hi Georg:

Could you elaborate a bit more why do you want to RAISE NOTICE 150000 times?

Regards

- Daniel.


> El 8 dic 2015, a las 11:37, Georg Brünsing <georg.bruensing@clickware.de> escribió:
> 
> The function creates ~16MB output. The VM needs ~200MB over statement.executeQuery(...).
> 
> CREATE OR REPLACE FUNCTION Test_Grosse_Logdatei() returns INTEGER AS
> $$
> DECLARE
> BEGIN
>     FOR i IN 1..150000 LOOP
>         RAISE notice '123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 ';
>     END LOOP;    
>     
>     RETURN 0;
> END;
> $$
> language plpgsql;
> 
> How can we reduce this?
> 
> Georg Brünsing
> 
> postgresql-9.4-1206-jdbc4.jar + postgresql-9.1-902.jdbc4.jar
> psql (PostgreSQL) 9.3.1
> Java(TM) SE Runtime Environment (build 1.8.0_66-b18) + Java(TM) SE Runtime Environment (build 1.7.0_75-b13) + Java(TM) SE Runtime Environment (build pxa6460sr7-20091215_02(SR7))
> JDK 6-8
> Windows/Linux
> 
> 

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: jdbc high memory consumption for RAISE NOTICE output using function-call in Java
@ 2015-12-08 13:48  Vladimir Sitnikov <sitnikov.vladimir@gmail.com>
  parent: Daniel Blanch Bataller <dblanch@hoplasoftware.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Vladimir Sitnikov @ 2015-12-08 13:48 UTC (permalink / raw)
  To: Georg Brünsing <georg.bruensing@clickware.de>; +Cc: pgsql-jdbc

>How can we reduce this?

It would be better not to abuse "raise ...".

However, if you cannot alter the software to remove that "raise", use
client_min_messages=WARNING:
http://www.postgresql.org/docs/9.4/static/runtime-config-logging.html#GUC-CLIENT-MIN-MESSAGES

Regards,
Vladimir Sitnikov


-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2015-12-08 13:48 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-12-08 10:37 jdbc high memory consumption for RAISE NOTICE output using function-call in Java Georg Brünsing <georg.bruensing@clickware.de>
2015-12-08 12:02 ` Daniel Blanch Bataller <dblanch@hoplasoftware.com>
2015-12-08 13:48   ` Vladimir Sitnikov <sitnikov.vladimir@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox