Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Can anyone help me with jms call in c language!

Can anyone help me with jms call in c language!

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminjsonperformancehelp
11 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W white jungle

    Hi,Every one: I just use jms lib to send message to jboss server. And I useing C to do this work. But I doubt there is memory leak when call jms api. I have a test with create one instance of Message and set the message with new text context when sending the message. After send 20000 messages,the memory requirement increase 2000K +. I don't know where I am wrong. So,please anyone can send me a sample with call JMS lib in C language. (include create context,connection ,send message and destroy all instance) Thank you very much! Don't look at me in that way!

    T Offline
    T Offline
    toxcct
    wrote on last edited by
    #2

    JMS, such as Java Message Service (message queues) ?


    TOXCCT >>> GEII power
    [toxcct][VisualCalc 2.20][VisualCalc 3.0]

    W 1 Reply Last reply
    0
    • T toxcct

      JMS, such as Java Message Service (message queues) ?


      TOXCCT >>> GEII power
      [toxcct][VisualCalc 2.20][VisualCalc 3.0]

      W Offline
      W Offline
      white jungle
      wrote on last edited by
      #3

      yes! But I need only topic! Don't look at me in that way!

      1 Reply Last reply
      0
      • W white jungle

        Hi,Every one: I just use jms lib to send message to jboss server. And I useing C to do this work. But I doubt there is memory leak when call jms api. I have a test with create one instance of Message and set the message with new text context when sending the message. After send 20000 messages,the memory requirement increase 2000K +. I don't know where I am wrong. So,please anyone can send me a sample with call JMS lib in C language. (include create context,connection ,send message and destroy all instance) Thank you very much! Don't look at me in that way!

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #4

        white jungle wrote:

        After send 20000 messages,the memory requirement increase 2000K +.

        How are you verifying this?


        "Take only what you need and leave the land as you found it." - Native American Proverb

        W 1 Reply Last reply
        0
        • D David Crow

          white jungle wrote:

          After send 20000 messages,the memory requirement increase 2000K +.

          How are you verifying this?


          "Take only what you need and leave the land as you found it." - Native American Proverb

          W Offline
          W Offline
          white jungle
          wrote on last edited by
          #5

          According to Performence moitor ,I can find it! Don't look at me in that way!

          D 1 Reply Last reply
          0
          • W white jungle

            According to Performence moitor ,I can find it! Don't look at me in that way!

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #6

            Are you sure that number is not just a "high-water mark?" In other words, like Task Manager, it must just be address space footprint of your module.


            "Take only what you need and leave the land as you found it." - Native American Proverb

            W 1 Reply Last reply
            0
            • D David Crow

              Are you sure that number is not just a "high-water mark?" In other words, like Task Manager, it must just be address space footprint of your module.


              "Take only what you need and leave the land as you found it." - Native American Proverb

              W Offline
              W Offline
              white jungle
              wrote on last edited by
              #7

              I have soled this problem now! I am sure that the number is not the peek value. I use the jms c lib in a multithread program,and whenever I create a text message,the lib will create the context for the message, so memory leaked. And now,I use a work thread to send the message and everything looks fine except re-connect to server.If I re-connect to server due to network issue,it looks leak some memory. Don't look at me in that way!

              D 1 Reply Last reply
              0
              • W white jungle

                I have soled this problem now! I am sure that the number is not the peek value. I use the jms c lib in a multithread program,and whenever I create a text message,the lib will create the context for the message, so memory leaked. And now,I use a work thread to send the message and everything looks fine except re-connect to server.If I re-connect to server due to network issue,it looks leak some memory. Don't look at me in that way!

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #8

                white jungle wrote:

                I have soled this problem now...If I re-connect to server due to network issue,it looks leak some memory.

                It sounds like the problem has simply changed location.


                "Take only what you need and leave the land as you found it." - Native American Proverb

                W 1 Reply Last reply
                0
                • D David Crow

                  white jungle wrote:

                  I have soled this problem now...If I re-connect to server due to network issue,it looks leak some memory.

                  It sounds like the problem has simply changed location.


                  "Take only what you need and leave the land as you found it." - Native American Proverb

                  W Offline
                  W Offline
                  white jungle
                  wrote on last edited by
                  #9

                  Yes!I think . I am testing the program now. Now,it had sent 140000+ messages and memory increased 428K. I want to keep the program running for 4 or 5 days. each days it will send 144000 pieces of messages. And each mesasge has 800 bytes content. Hope it has a peek memory useage! ^_^ Don't look at me in that way!

                  D 1 Reply Last reply
                  0
                  • W white jungle

                    Yes!I think . I am testing the program now. Now,it had sent 140000+ messages and memory increased 428K. I want to keep the program running for 4 or 5 days. each days it will send 144000 pieces of messages. And each mesasge has 800 bytes content. Hope it has a peek memory useage! ^_^ Don't look at me in that way!

                    D Offline
                    D Offline
                    David Crow
                    wrote on last edited by
                    #10

                    Are you allocating memory someplace that is not being deallocated?


                    "Take only what you need and leave the land as you found it." - Native American Proverb

                    W 1 Reply Last reply
                    0
                    • D David Crow

                      Are you allocating memory someplace that is not being deallocated?


                      "Take only what you need and leave the land as you found it." - Native American Proverb

                      W Offline
                      W Offline
                      white jungle
                      wrote on last edited by
                      #11

                      I use the lib in a simple way as follow: When the application run,I will start a new thread which will be end while application die! In the new thread I will check if there is any message in the message stack.If so,send it using JMS lib.or else,just wait a short while. The stack manager was written using STL. And I haven't allocate any memory explicity in my application. Do you have any idea! Today!I checked the running status of the application . I find that there are only 524K memory increasement while sending 570000 messages.Maybe it's a good news.^_^ Don't look at me in that way!

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups