[CONJ-110] Wastage of memory Created: 2014-08-30 Updated: 2016-08-23 Resolved: 2016-08-23 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | Other |
| Affects Version/s: | 1.1.7 |
| Fix Version/s: | 1.5.1-RC |
| Type: | Bug | Priority: | Major |
| Reporter: | Kavneet Kaur | Assignee: | Diego Dupin |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Description |
|
~maria-captains/mariadb-java-client/trunk : /src/test/java/org/mariadb/jdbc/BigQueryTest.java (revision 516) Big Query activated in this, contains a char array of 20000000. |
| Comments |
| Comment by Kavneet Kaur [ 2014-08-30 ] |
|
This is something that can be modified. All big queries possible cannot occupy this space. This is sort of leading to more of wastage of memory. The same could be done at a size (50-90)% lesser. |
| Comment by Vladislav Vaintroub [ 2014-09-13 ] |
|
The test is actually fine , the only thing it needs is better documentation. |
| Comment by Kavneet Kaur [ 2014-09-14 ] |
|
Point is 'if' even when the big query is not being executed, still the code is compiled upon call. Using array data structure leads to reservation and thus wastage. If the data structure used could be dynamic like linked list, it would not only resolve the issue of wastage but would also support queries bigger than the supported one. |
| Comment by Vladislav Vaintroub [ 2014-09-14 ] |
|
Hmm, dont really get this point. It is Java, i.e arrays , like everything else is allocated on heap. There is no allocation upon compilation . Also, that char array is used to constuct a big String that is passed to executeUpdate(). There is no way to use linked list to construct String , is there? |
| Comment by Kavneet Kaur [ 2014-09-15 ] |
|
We can create a class to do something like linked list. Java obviously can't implement linked list because of no-pointer concept. |
| Comment by Massimo Siani (Inactive) [ 2014-11-10 ] |
|
I don't get this one. What's the purpose here? I may be wrong, but any list will use more memory than an array. |
| Comment by Kavneet Kaur [ 2014-12-19 ] |
|
instead of specifying the size, we can use: this should server a better alternative to the static allocation and reservation. |
| Comment by Diego Dupin [ 2016-08-23 ] |
|
Test now is checking max_allowed_packet size before using arrays. Current implementation is way faster than other implementations that are using less memory. |