B4J Question [RESOLVED] Server Out of Memory Error

Discussion in 'B4J Questions' started by Jmu5667, Apr 23, 2018.

  1. OliverA

    OliverA Well-Known Member Licensed User

    Your string changes constantly. Each call to AddNonQueryBatch has different public_id and public_device_id. You see, the string is created with the different Id's before it is passed to the underlying routine. The routine does not get the rs.GetString methods, rather those methods are executed and a new string created before the new string is passed to the underlying routine of AddNonQueryBatch. Therefore, each call to AddNonQueryBatch has a different string. I, on the other hand, use the same string. Nothing changes, only the parameters that are passed as a different argument.

    Wish: https://www.b4x.com/android/forum/t...nt-addnonquery2args-execnonquery2batch.92290/

    BTW: Funny how both of us were thinking about the underlying code of AddNonQueryBatch.

    Note 2: And that's why code optimization at times may be done in the wrong place. SQL calls are very expensive, so the small changes done here have a minuscule impact in comparison, and therefore a may be considered a nit-pick (or waste of time).
     
  2. Jmu5667

    Jmu5667 Well-Known Member Licensed User


    Cool, get it now !

    BTW: Great minds think alike, and fools, well we know the answer to that one :)
     
  3. Enrique Gonzalez R

    Enrique Gonzalez R Well-Known Member Licensed User

    to put my grain.

    this is not the correct way to write text in B4x:

    Code:
    Dim sSQL1 As String = "UPDATE [IS_SYSTEM].dbo.devices_hello " & _
                       
    "SET " & _
                       
    "active_user = '', " & _
                       
    "active = 0, " & _
                       
    "last_user = ?, " & _
                       
    "last_user_exitcode = 2 " & _
                       
    "WHERE device_id = ?"
    use smartstrings

    Code:
    Dim sSQL1 As String = $"
            UPDATE[IS_SYSTEM].dbo.devices_hello
                SET 
                    ACTIVE_user = ''
                  , Active = 0
                  , lastuser = ?
                  , last_user_exitcode = 2
                WHERE device_id = ? 
        "$

    no it will not add any performance, but will be much easier to pass queries between the IDE and the SQL ide.
     
    Erel likes this.
  4. Jmu5667

    Jmu5667 Well-Known Member Licensed User

    Update: @OliverA

    1. Server App Running for 161 hours, contant client connections.

    upload_2018-5-4_8-31-2.png

    upload_2018-5-4_8-35-35.png


    2. java -XX:+UseG1GC -XX:NewSize=64m -XX:MaxNewSize=64m -Xbootclasspath/p:alpn-boot-8.1.11.v20170118.jar -jar ies_svr_aspect_hello.jar

    3. Task Manager memory usage seems to have reached 172mb and hovers around this.

    upload_2018-5-4_8-33-25.png


    I hope this has solved any issues I had, and hope someone else finds it useful.

    Regards

    John.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice