Details

    • Type: Bug
    • Status: Stalled
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.7
    • Fix Version/s: None
    • Component/s: None
    • 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.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            Kavneetk Kavneet Kaur added a comment -

            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.

            Show
            Kavneetk Kavneet Kaur added a comment - 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.
            Hide
            wlad Vladislav Vaintroub added a comment -

            The test is actually fine , the only thing it needs is better documentation.
            The purpose of it is to check how the driver behaves, if the query can't fit into single MySQL packet (must be about 16MB). The point that queries cannot be large is also wrong, mainly due to (default) prepared statement implementation on the client-side . If you send a blob, then large query is generated, and blobs can easily be larger than 16MB.

            Show
            wlad Vladislav Vaintroub added a comment - The test is actually fine , the only thing it needs is better documentation. The purpose of it is to check how the driver behaves, if the query can't fit into single MySQL packet (must be about 16MB). The point that queries cannot be large is also wrong, mainly due to (default) prepared statement implementation on the client-side . If you send a blob, then large query is generated, and blobs can easily be larger than 16MB.
            Hide
            Kavneetk Kavneet Kaur added a comment -

            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.

            Show
            Kavneetk Kavneet Kaur added a comment - 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.
            Hide
            wlad Vladislav Vaintroub added a comment -

            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?

            Show
            wlad Vladislav Vaintroub added a comment - 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?
            Hide
            Kavneetk Kavneet Kaur added a comment -

            We can create a class to do something like linked list. Java obviously can't implement linked list because of no-pointer concept.

            Show
            Kavneetk Kavneet Kaur added a comment - We can create a class to do something like linked list. Java obviously can't implement linked list because of no-pointer concept.
            Hide
            massimo.siani Massimo Siani added a comment -

            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.
            Can you be more specific?

            Show
            massimo.siani Massimo Siani added a comment - 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. Can you be more specific?
            Hide
            Kavneetk Kavneet Kaur added a comment - - edited

            instead of specifying the size, we can use:
            1. dynamic allocation,
            2. Collections in Util package
            3. RandomAccess Interface
            4. MapInterface

            this should server a better alternative to the static allocation and reservation.

            Show
            Kavneetk Kavneet Kaur added a comment - - edited instead of specifying the size, we can use: 1. dynamic allocation, 2. Collections in Util package 3. RandomAccess Interface 4. MapInterface this should server a better alternative to the static allocation and reservation.

              People

              • Assignee:
                massimo.siani Massimo Siani
                Reporter:
                Kavneetk Kavneet Kaur
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: