You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/10/25 11:50:24 UTC

[GitHub] [doris] Gabriel39 opened a new pull request, #13657: [Bug](jdbc) Fix memory leak for JDBC datasource

Gabriel39 opened a new pull request, #13657:
URL: https://github.com/apache/doris/pull/13657

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [ ] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   3. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [ ] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [ ] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [ ] No
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] morningman commented on a diff in pull request #13657: [Bug](jdbc) Fix memory leak for JDBC datasource

Posted by GitBox <gi...@apache.org>.
morningman commented on code in PR #13657:
URL: https://github.com/apache/doris/pull/13657#discussion_r1004558418


##########
be/src/util/jni-util.cpp:
##########
@@ -39,13 +39,17 @@ void FindOrCreateJavaVM() {
     if (rv == 0) {
         JNIEnv* env;
         JavaVMInitArgs vm_args;
-        JavaVMOption options[1];
+        JavaVMOption options[2];
         char* str = getenv("DORIS_JNI_CLASSPATH_PARAMETER");
         options[0].optionString = str;
+        // Set max heap size to 4G.
+        std::string heap_size("-Xmx4096M");

Review Comment:
   This should be a `config`



##########
fe/java-udf/pom.xml:
##########
@@ -70,6 +70,11 @@ under the License.
             <version>${junit.version}</version>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>com.zaxxer</groupId>
+            <artifactId>HikariCP</artifactId>
+            <version>${hikaricp.version}</version>

Review Comment:
   Add this to `dist/LICENSE-dist.txt`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #13657: [Bug](jdbc) Fix memory leak for JDBC datasource

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #13657:
URL: https://github.com/apache/doris/pull/13657#issuecomment-1291570390

   PR approved by at least one committer and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] github-actions[bot] commented on pull request #13657: [Bug](jdbc) Fix memory leak for JDBC datasource

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #13657:
URL: https://github.com/apache/doris/pull/13657#issuecomment-1291570413

   PR approved by anyone and no changes requested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] Gabriel39 merged pull request #13657: [Bug](jdbc) Fix memory leak for JDBC datasource

Posted by GitBox <gi...@apache.org>.
Gabriel39 merged PR #13657:
URL: https://github.com/apache/doris/pull/13657


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] zhangstar333 commented on a diff in pull request #13657: [Bug](jdbc) Fix memory leak for JDBC datasource

Posted by GitBox <gi...@apache.org>.
zhangstar333 commented on code in PR #13657:
URL: https://github.com/apache/doris/pull/13657#discussion_r1004446614


##########
be/src/vec/exec/vjdbc_connector.cpp:
##########
@@ -41,22 +42,26 @@ const char* JDBC_EXECUTOR_TRANSACTION_SIGNATURE = "()V";
 JdbcConnector::JdbcConnector(const JdbcConnectorParam& param)
         : TableConnector(param.tuple_desc, param.query_string), _conn_param(param) {}
 
-JdbcConnector::~JdbcConnector() {
+Status JdbcConnector::close() {
     if (!_is_open) {
-        return;
+        return Status::OK();
     }
     if (_is_in_transaction) {
-        abort_trans();
+        RETURN_IF_ERROR(abort_trans());
     }
     JNIEnv* env;
-    Status status;
-    RETURN_IF_STATUS_ERROR(status, JniUtil::GetJNIEnv(&env));
+    RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env));
+    env->DeleteGlobalRef(_executor_clazz);
+    env->DeleteGlobalRef(_executor_list_clazz);
+    env->DeleteGlobalRef(_executor_object_clazz);
+    env->DeleteGlobalRef(_executor_string_clazz);

Review Comment:
   could add those variables:  jclass _executor_##RETURN_TYPE##_clazz;



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [doris] zhangstar333 commented on a diff in pull request #13657: [Bug](jdbc) Fix memory leak for JDBC datasource

Posted by GitBox <gi...@apache.org>.
zhangstar333 commented on code in PR #13657:
URL: https://github.com/apache/doris/pull/13657#discussion_r1004482088


##########
be/src/vec/exec/vjdbc_connector.cpp:
##########
@@ -121,7 +128,7 @@ Status JdbcConnector::query() {
     RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env));
     jstring query_sql = env->NewStringUTF(_sql_str.c_str());
     jint colunm_count = env->CallNonvirtualIntMethod(_executor_obj, _executor_clazz,
-                                                     _executor_query_id, query_sql);
+                                                     _executor_read_id, query_sql);

Review Comment:
   I see register read function is `int read() `?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org