geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-6414) PdxInstanceFactory uses too much memory when it creates a PdxInstance
Date Fri, 22 Feb 2019 17:45:00 GMT

    [ https://issues.apache.org/jira/browse/GEODE-6414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16775441#comment-16775441
] 

ASF subversion and git services commented on GEODE-6414:
--------------------------------------------------------

Commit 65babba546013dbdc17e9ce657d09206e0131e31 in geode's branch refs/heads/develop from
Darrel Schneider
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=65babba ]

GEODE-6414: PdxInstanceFactory uses too much memory when it creates a PdxInstance (#3200)

Two causes of using too much memory have been identified:

1. PdxInstanceFactory.create() will register a duplicate PdxType when there is already an
identical PdxType in the type registry. It should reuse the PdxType that is already in the
type registry instead.
2. The HeapByteBuffer may have extra unused memory in it. A ByteBuffer of the size needed
can be allocated and the bytes from the larger one copied into it.

To solve the second issue a new method on HeapDataOutputStream was
added that supports throwing away a specified number of initial bytes in
the stream when converting it to a ByteBuffer. PdxInstanceFactory always
throws away the first 9 bytes. This method also optimizes the creations done by
the factory when the serialized bytes exceed 1024.

Co-authored-by: Darrel Schneider <dschneider@pivotal.io>
Co-authored-by: Xiaojian Zhou <gzhou@pivotal.io>
Co-authored-by: Jianxia Chen <jchen@pivotal.io>
Co-authored-by: Benjamin Ross <bross@pivotal.io>


> PdxInstanceFactory uses too much memory when it creates a PdxInstance
> ---------------------------------------------------------------------
>
>                 Key: GEODE-6414
>                 URL: https://issues.apache.org/jira/browse/GEODE-6414
>             Project: Geode
>          Issue Type: Bug
>            Reporter: Jianxia Chen
>            Assignee: Darrel Schneider
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.10.0
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> Two causes of using too much memory have been identified:
> 1. PdxInstanceFactory.create() will register a duplicate PdxType when there is already
an identical PdxType in the type registry. It should reuse the PdxType that is already in
the type registry instead.
> 2. The HeapByteBuffer may have extra unused memory in it. A ByteBuffer of the size needed
can be allocated and the byte from the larger one copied into it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message