[jira] [Commented] (AVRO-1707) Java serialization readers/writers in generated Java classes

2016-04-17 Thread Zoltan Farkas (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15245015#comment-15245015
 ] 

Zoltan Farkas commented on AVRO-1707:
-

No problems with the practice if the readers are fixed to stop keeping 
references to a thread... (which were the cause of large memory waste in our 
apps)
 
In  our use cases java serialization is not a common use case so it seemed like 
a waste to have these readers and writers initialized without being used... and 
it is so simple to make this lazy and being initialized only when needed...



> Java serialization readers/writers in generated Java classes
> 
>
> Key: AVRO-1707
> URL: https://issues.apache.org/jira/browse/AVRO-1707
> Project: Avro
>  Issue Type: Improvement
>Affects Versions: 1.8.0
>Reporter: Zoltan Farkas
>
> the following static instances are declared in the generated classes:
>   private static final org.apache.avro.io.DatumWriter
> WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);  
>   private static final org.apache.avro.io.DatumReader
> READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);  
>  the reaser/writer hold on to a reference to the "Creator Thread":
> "private final Thread creator;"
> which inhibits GC-ing thread locals... for this thread...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (AVRO-1707) Java serialization readers/writers in generated Java classes

2015-10-19 Thread Ryan Blue (JIRA)

[ 
https://issues.apache.org/jira/browse/AVRO-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14963947#comment-14963947
 ] 

Ryan Blue commented on AVRO-1707:
-

[~zolyfarkas], good catch on the thread-local gc problem. I'd like to get that 
in. I'm not sure about the Lazy datum reader/writer though. It seems like two 
objects for each Avro class used is fairly reasonable and probably not worth 
the laziness. Are you seeing a problem with this in practice?

> Java serialization readers/writers in generated Java classes
> 
>
> Key: AVRO-1707
> URL: https://issues.apache.org/jira/browse/AVRO-1707
> Project: Avro
>  Issue Type: Improvement
>Affects Versions: 1.8.0
>Reporter: Zoltan Farkas
>
> the following static instances are declared in the generated classes:
>   private static final org.apache.avro.io.DatumWriter
> WRITER$ = new org.apache.avro.specific.SpecificDatumWriter(SCHEMA$);  
>   private static final org.apache.avro.io.DatumReader
> READER$ = new org.apache.avro.specific.SpecificDatumReader(SCHEMA$);  
>  the reaser/writer hold on to a reference to the "Creator Thread":
> "private final Thread creator;"
> which inhibits GC-ing thread locals... for this thread...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)