[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17104162#comment-17104162 ] LEE PYUNG BEOM commented on IGNITE-12543: - +{color:#0066cc}Aleksey Plekhanov{color}+ Yes. As you mentioned, I think this bug is fixed by tickert IGNITE-12827. Thank you so much. > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17102686#comment-17102686 ] Aleksey Plekhanov commented on IGNITE-12543: [~sunghan.suh], [~redcomet] can you check your case against the current master branch? I think your problem is fixed by ticket IGNITE-12827. > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17061633#comment-17061633 ] Sunghan Suh commented on IGNITE-12543: -- [~Pavlukhin], the above comment is extactly same as what we have wanted to resolve. I leave a message for your confirmation request. > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17061604#comment-17061604 ] Ivan Pavlukhin commented on IGNITE-12543: - (y) > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17061585#comment-17061585 ] Aleksey Plekhanov commented on IGNITE-12543: [~Pavlukhin] when we marshal {{List}} on thin client side there is no size overhead. Overhead appears on the server-side when we unmarshal (with keep binary) byte array to {{List}} and marshal it again. Each binary object after unmarshalling refers to the same full byte array (with offset and length), then this byte array is copied for each object by {{doWriteBinaryObject}} method during second marshaling. If we will avoid double marshaling, the object will be stored in the form thin client marshal it (without size grow) and then transferred back to the thin client in the same form. So, yes, number of bytes transferred over the wire will be adequate after fixing IGNITE-12625 > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17061496#comment-17061496 ] Ivan Pavlukhin commented on IGNITE-12543: - [~alex_pl], thank you for details. But will be a number of bytes transferred over the wire adequate after fixing IGNITE-12625 or there still will be a size explosion? Beforehand we observed an explosion when SQL columns of type {{List}} had been transferred over the wire. The root cause is a code fragment mentioned before: {code: java} // org.apacheignite.internal.binary.BinaryWriterExImpl.java public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { if (po == null) out.writeByte(GridBinaryMarshaller.NULL); else { byte[] poArr = po.array(); out.unsafeEnsure(1 + 4 + poArr.length +4); out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); out.unsafeWriteInt(poArr.length); out.writeByteArray(poArr); out.unsafeWriteInt(po.start()); } } {code} > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17060676#comment-17060676 ] Sunghan Suh commented on IGNITE-12543: -- [~Pavlukhin] , as we wrote in the description, we can observe enormous size in the storage like that. If the above data contains five objects of 200KB size, ten by one, 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and transfer. We were not able to do service by thin client, then we rolled it back. > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17060671#comment-17060671 ] Aleksey Plekhanov commented on IGNITE-12543: [~Pavlukhin] when we put an object to cache from thin client object size transferring from thin client to server is normal. But after this stage (after packing the object to {{CacheObject)}} object size increases significantly and Ignite use this increased object size for all other stages (in storage, for transferring over the wire from one server node to another, for transferring over the wire for thin client {{get}} operation, etc.) > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17060509#comment-17060509 ] Ivan Pavlukhin commented on IGNITE-12543: - [~alex_pl], I might have missed that the object size increases significantly inside a storage. I mostly concerned about transferring over the wire (I remember even some OOMs related to it) which is caused by {{BinaryWriterExImpl.doWriteBinaryObject}} as well. [~redcomet], [~sunghan.suh], can you confirm that in your case enormous size is observed in a storage? > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17058505#comment-17058505 ] Aleksey Plekhanov commented on IGNITE-12543: [~Pavlukhin], I think the best way to solve this issue is to fix IGNITE-12625 I've checked object size produced by the following code: {code:java} public void testSize() throws Exception { try (Ignite ignite = Ignition.start(Config.getServerConfiguration()); IgniteClient client = Ignition.startClient(getClientConfiguration()) ) { List obj = new ArrayList<>(); for (int i = 0; i < 100; i++) obj.add(new TestClass()); client.getOrCreateCache(Config.DEFAULT_CACHE_NAME).put(0, obj); } } private static class TestClass { byte[] arr = new byte[100]; } {code} After object {{obj}} is marshalled by thin client the whole request size is 13426 bytes (20 bytes - request header + key size, 6 bytes value collection header, 134 bytes * 100 items - collection items), but when this object is unmarshalled (on server side) and marshalled second time (before put it into cache) size of corresponding {{CacheObject}} instance grows to 1343506 bytes (6 bytes collection header, 13435 bytes * 100 items - collection items). Each collection item occupying 13435 bytes now - its original request size (whole byte array is copied each time) + binary object header. > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17054896#comment-17054896 ] Ivan Pavlukhin commented on IGNITE-12543: - [~sunghan.suh], thank you for your efforts. I must say that the proposed fix cannot be applied as is. I run tests against PR and there are critical failures. Here are results [report|https://mtcga.gridgain.com/pr.html?serverId=apache&suiteId=IgniteTests24Java8_RunAll&branchForTc=pull/7403/head&action=Latest]. And most illustrative one is a failure of [Binary Objects|https://ci.ignite.apache.org/buildConfiguration/IgniteTests24Java8_BinaryObjects?branch=pull%2F7403%2Fhead&mode=builds] test suite. And actually the reason was already mentioned in comments. bq. Initially the protocol was designed to be universal and able to serialize objects of any complexity (nested objects, circular references). Consider an example to make things clear. {code:java} // Node of a doubly linked list class Node { Node next, prev; String val; } {code} In a list of two elements we have 2 nodes having references to each other. Some trick is needed to serialize such structure. In _Binary Object_ format it is called _handles_. Let's call these 2 list elements A and B. In a serialized form we can start writing A: {noformat} [prev:null, val:A, next:?] {noformat} Let's write A.next = B directly: {noformat} [prev:null, val:A, next:[prev:?, val:B, next:null]] {noformat} What should be written as B.prev = A? writing it directly as before will lead to infinite recursion. So, a _handle_ (i.e. reference) is written. You can find more details about _Binary Object_ format in a following [article|https://cwiki.apache.org/confluence/display/IGNITE/Binary+object+format]. And returning to the issue we need to answer the question why more bytes than a specific object takes is written during serialization. If we need to serialize node B from the provided example we need to serialize node A as well. In current implementation we simply take all bytes from top-most binary object. In such fashion we can serialize and transfer objects of any structure safely. Currently I do not have a simple solution in my mind how this issue could be fixed while keeping the ability to serialize any object. > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17054655#comment-17054655 ] Sunghan Suh commented on IGNITE-12543: -- Hello, [~Pavlukhin]. I'm a leader of an open source development group in Samsung. As [~redcomet] explained, we suffered from this issue in a mission critical system. I know limitations in the previous comment, but the patch we have uploaded can fix our prolem with ease and it doesn't affect other codes. Please review [GitHub Pull Request #7403|https://github.com/apache/ignite/pull/7403] positively, and let us end it gracefully. Thank you for your times. > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (IGNITE-12543) When put List>, the data was increased much larger.
[ https://issues.apache.org/jira/browse/IGNITE-12543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17019435#comment-17019435 ] Ivan Pavlukhin commented on IGNITE-12543: - [~redcomet], thank you for reporting this issue. In fact there are multiple limitations in BinaryObject serialization protocol. Initially the protocol was designed to be universal and able to serialize objects of any complexity (nested objects, circular references). The downside is that the protocol is not efficient sometimes. Will a workaround with wrapping a list by a custom wrapper class work for you? {code} public class Wrapper { private T object; ... } {code} > When put List>, the data was increased much larger. > > > Key: IGNITE-12543 > URL: https://issues.apache.org/jira/browse/IGNITE-12543 > Project: Ignite > Issue Type: Bug > Components: thin client >Affects Versions: 2.6 >Reporter: LEE PYUNG BEOM >Priority: Major > > I use Ignite 2.6 version of Java Thin Client. > > When I put data in the form List>, > The size of the original 200KB data was increased to 50MB when inquired by > Ignite servers. > On the Heap Dump, the list element was repeatedly accumulated, increasing the > data size. > > When I checked org.apacheignite.internal.binary.BinaryWriterExImpl.java > doWriteBinaryObject() method, > {code:java} > // org.apacheignite.internal.binary.BinaryWriterExImpl.java > public void doWriteBinaryObject(@Nullable BinaryObjectImpl po) { > if (po == null) > out.writeByte(GridBinaryMarshaller.NULL); > else { > byte[] poArr = po.array(); > out.unsafeEnsure(1 + 4 + poArr.length +4); > out.unsafeWriteByte(GridBinaryMarshaller.BINARY_OBJ); > out.unsafeWriteInt(poArr.length); > out.writeByteArray(poArr); > out.unsafeWriteInt(po.start()); > } > } > {code} > > The current Ignite implementation for storing data in the form > List> is: > In the Marshalling stage, for example, data the size of List(5 > members) is: > As many as 10*5 of the list's elements are duplicated. > If the above data contains five objects of 200KB size, ten by one, > 50 iterations are stored and 200K*10**5 = 100MB of data is used for cache and > transfer. > As a result of this increase in data size, it is confirmed that the failure > of OOM, GC, etc. is caused by occupying Heap memory. > Unnecessarily redundant data is used for cache storage and network transport. > When looking up cache data, only some of the data at the top is read based on > file location information from the entire data, so that normal data is > retrieved. > The way we're implemented today is safe from basic behavior, but we're > wasting memory and network unnecessarily using inefficient algorithms > This can have very serious consequences. Please check. > > -- This message was sent by Atlassian Jira (v8.3.4#803005)