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. The Lounge
  3. Java and .NET memory usage?

Java and .NET memory usage?

Scheduled Pinned Locked Moved The Lounge
questioncsharpjavawinformstesting
19 Posts 11 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.
  • P Offline
    P Offline
    Paul Selormey
    wrote on last edited by
    #1

    What is the real picture here? We have a project to create a Gantt control. The data format is still not done, and so I have decided to create a sample data format for testing (I am working on the main control). So, I downloaded Java application GanttProject and created a sample. With the sample project created, the Java application is shown 3 MB memory usage. For my incomplete control placed on a Windows forms with no data loaded, it is about 20 MB memory usage! What is the real stats here? anyone? Best regards, Paul.

    Jesus Christ is LOVE! Please tell somebody.

    C S S E J 6 Replies Last reply
    0
    • P Paul Selormey

      What is the real picture here? We have a project to create a Gantt control. The data format is still not done, and so I have decided to create a sample data format for testing (I am working on the main control). So, I downloaded Java application GanttProject and created a sample. With the sample project created, the Java application is shown 3 MB memory usage. For my incomplete control placed on a Windows forms with no data loaded, it is about 20 MB memory usage! What is the real stats here? anyone? Best regards, Paul.

      Jesus Christ is LOVE! Please tell somebody.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Remember you pay the initial price of the framework, which means that you get an initial jump that stays static.

      Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

      P 1 Reply Last reply
      0
      • C Christian Graus

        Remember you pay the initial price of the framework, which means that you get an initial jump that stays static.

        Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

        P Offline
        P Offline
        Paul Selormey
        wrote on last edited by
        #3

        Do you mind explaining why this makes a difference, since they are similar framework? Best regards, Paul.

        Jesus Christ is LOVE! Please tell somebody.

        C S 2 Replies Last reply
        0
        • P Paul Selormey

          Do you mind explaining why this makes a difference, since they are similar framework? Best regards, Paul.

          Jesus Christ is LOVE! Please tell somebody.

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Because .NET takes up more room ( from the sound of it ). 20 MB is normal, but I am saying, that won't scale to being 40 MB when your Java app hits 6 MB. It probably takes up more because Java is crap :P

          Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

          1 Reply Last reply
          0
          • P Paul Selormey

            Do you mind explaining why this makes a difference, since they are similar framework? Best regards, Paul.

            Jesus Christ is LOVE! Please tell somebody.

            S Offline
            S Offline
            Shog9 0
            wrote on last edited by
            #5

            I'll speculate: Java is older, and so had to be optimized for a smaller memory footprint - 3MB was huge back in 1995 when Java was first released! Indeed, Java has a reputation for being slow and bloated to this day simply because of the system requirements it demanded over a decade ago... Being newer, the developers may well have been under far less pressure to optimize this aspect of the .NET runtime.

            1 Reply Last reply
            0
            • P Paul Selormey

              What is the real picture here? We have a project to create a Gantt control. The data format is still not done, and so I have decided to create a sample data format for testing (I am working on the main control). So, I downloaded Java application GanttProject and created a sample. With the sample project created, the Java application is shown 3 MB memory usage. For my incomplete control placed on a Windows forms with no data loaded, it is about 20 MB memory usage! What is the real stats here? anyone? Best regards, Paul.

              Jesus Christ is LOVE! Please tell somebody.

              S Offline
              S Offline
              S Senthil Kumar
              wrote on last edited by
              #6

              How did you measure the memory usage? Is it working set size of VM size?

              Regards Senthil [MVP - Visual C#] _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

              P 1 Reply Last reply
              0
              • S S Senthil Kumar

                How did you measure the memory usage? Is it working set size of VM size?

                Regards Senthil [MVP - Visual C#] _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

                P Offline
                P Offline
                Paul Selormey
                wrote on last edited by
                #7

                There is not special measurement, just looking at the system task manager. Best regards, Paul.

                Jesus Christ is LOVE! Please tell somebody.

                S R 2 Replies Last reply
                0
                • P Paul Selormey

                  There is not special measurement, just looking at the system task manager. Best regards, Paul.

                  Jesus Christ is LOVE! Please tell somebody.

                  S Offline
                  S Offline
                  S Senthil Kumar
                  wrote on last edited by
                  #8

                  That could be misleading though - the Mem Usage column in Task Manager shows the working set of a process i.e. the amount of physical memory currently taken up by it. In reality, the application could be using up a lot more virtual memory. The VM Size column in Task Manager is a more reliable way to check memory consumption ( the best way is to use perfmon). If the amount of virtual memory is the same, then it could be that the JVM and CLR have different algorithms to control working set size - Windows has a SetProcessWorkingSetSize[^] API to control that.

                  Regards Senthil [MVP - Visual C#] _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

                  P 1 Reply Last reply
                  0
                  • P Paul Selormey

                    There is not special measurement, just looking at the system task manager. Best regards, Paul.

                    Jesus Christ is LOVE! Please tell somebody.

                    R Offline
                    R Offline
                    Rajesh R Subramanian
                    wrote on last edited by
                    #9

                    You're talking about the address spaces and not the actual memory being used by those two processes. Joe has a brief article on this: How big is my app[^]

                    It is a crappy thing, but it's life -^ Carlo Pallini

                    1 Reply Last reply
                    0
                    • S S Senthil Kumar

                      That could be misleading though - the Mem Usage column in Task Manager shows the working set of a process i.e. the amount of physical memory currently taken up by it. In reality, the application could be using up a lot more virtual memory. The VM Size column in Task Manager is a more reliable way to check memory consumption ( the best way is to use perfmon). If the amount of virtual memory is the same, then it could be that the JVM and CLR have different algorithms to control working set size - Windows has a SetProcessWorkingSetSize[^] API to control that.

                      Regards Senthil [MVP - Visual C#] _____________________________ My Home Page |My Blog | My Articles | My Flickr | WinMacro

                      P Offline
                      P Offline
                      Paul Selormey
                      wrote on last edited by
                      #10

                      Thanks for the information.

                      S. Senthil Kumar wrote:

                      The VM Size column in Task Manager is a more reliable way to check memory consumption ( the best way is to use perfmon).

                      It is worse, I will try using the perfmon later. Best regards, Paul.

                      Jesus Christ is LOVE! Please tell somebody.

                      1 Reply Last reply
                      0
                      • P Paul Selormey

                        What is the real picture here? We have a project to create a Gantt control. The data format is still not done, and so I have decided to create a sample data format for testing (I am working on the main control). So, I downloaded Java application GanttProject and created a sample. With the sample project created, the Java application is shown 3 MB memory usage. For my incomplete control placed on a Windows forms with no data loaded, it is about 20 MB memory usage! What is the real stats here? anyone? Best regards, Paul.

                        Jesus Christ is LOVE! Please tell somebody.

                        S Offline
                        S Offline
                        Super Lloyd
                        wrote on last edited by
                        #11

                        What I am about to say is mostly conclusion based on hear say and bare minimum investigation long time ago. But I'll bet, chances are, that "big" Java application are more system resources greedy than big .NET ones. Maybe small Java app are less greedy, that won't surprise me too much. It was meant to run in the browser, as a consumer oriented applet.

                        A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

                        P 1 Reply Last reply
                        0
                        • S Super Lloyd

                          What I am about to say is mostly conclusion based on hear say and bare minimum investigation long time ago. But I'll bet, chances are, that "big" Java application are more system resources greedy than big .NET ones. Maybe small Java app are less greedy, that won't surprise me too much. It was meant to run in the browser, as a consumer oriented applet.

                          A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

                          P Offline
                          P Offline
                          Paul Selormey
                          wrote on last edited by
                          #12

                          Super Lloyd wrote:

                          But I'll bet, chances are, that "big" Java application are more system resources greedy than big .NET ones.

                          Do you consider something like Eclipse big enough for this? Best regards, Paul.

                          Jesus Christ is LOVE! Please tell somebody.

                          S 1 Reply Last reply
                          0
                          • P Paul Selormey

                            Super Lloyd wrote:

                            But I'll bet, chances are, that "big" Java application are more system resources greedy than big .NET ones.

                            Do you consider something like Eclipse big enough for this? Best regards, Paul.

                            Jesus Christ is LOVE! Please tell somebody.

                            S Offline
                            S Offline
                            Super Lloyd
                            wrote on last edited by
                            #13

                            I would say so.... But you are going to tell me that Eclipse is quite lean, isn't it? I know at work I was wondering what does Sun benefit from Java. And one of my coworker draw from his past experience where they had a powerful server which run like a dog some Java ERP for only 32 user. And that tells me that server sales does benefit from Java....

                            A train station is where the train stops. A bus station is where the bus stops. On my desk, I have a work station.... _________________________________________________________ My programs never have bugs, they just develop random features.

                            1 Reply Last reply
                            0
                            • P Paul Selormey

                              What is the real picture here? We have a project to create a Gantt control. The data format is still not done, and so I have decided to create a sample data format for testing (I am working on the main control). So, I downloaded Java application GanttProject and created a sample. With the sample project created, the Java application is shown 3 MB memory usage. For my incomplete control placed on a Windows forms with no data loaded, it is about 20 MB memory usage! What is the real stats here? anyone? Best regards, Paul.

                              Jesus Christ is LOVE! Please tell somebody.

                              E Offline
                              E Offline
                              Ennis Ray Lynch Jr
                              wrote on last edited by
                              #14

                              http://java.sys-con.com/node/37060[^]

                              Need custom software developed? I do C# development and consulting all over the United States. A man said to the universe: "Sir I exist!" "However," replied the universe, "The fact has not created in me A sense of obligation." --Stephen Crane

                              1 Reply Last reply
                              0
                              • P Paul Selormey

                                What is the real picture here? We have a project to create a Gantt control. The data format is still not done, and so I have decided to create a sample data format for testing (I am working on the main control). So, I downloaded Java application GanttProject and created a sample. With the sample project created, the Java application is shown 3 MB memory usage. For my incomplete control placed on a Windows forms with no data loaded, it is about 20 MB memory usage! What is the real stats here? anyone? Best regards, Paul.

                                Jesus Christ is LOVE! Please tell somebody.

                                J Offline
                                J Offline
                                Joaquim Rendeiro
                                wrote on last edited by
                                #15

                                Might it be that the Java app is drawing everything with custom paint logic and your .net app uses a lot of controls? (usually it's easy to tell from the looks of it, but I don't have Java in this PC so I can't try it)

                                P 1 Reply Last reply
                                0
                                • J Joaquim Rendeiro

                                  Might it be that the Java app is drawing everything with custom paint logic and your .net app uses a lot of controls? (usually it's easy to tell from the looks of it, but I don't have Java in this PC so I can't try it)

                                  P Offline
                                  P Offline
                                  Paul Selormey
                                  wrote on last edited by
                                  #16

                                  Joaquim Rendeiro wrote:

                                  Might it be that the Java app is drawing everything with custom paint logic and your .net app uses a lot of controls?

                                  The applications are similar, list/grid, splitter and gantt chart view. The Java app has toolbar, menu and status bar, dialogs etc (a complete application). The .NET app is just started, no dialog etc and does no real drawing yet. Best regards, Paul.

                                  Jesus Christ is LOVE! Please tell somebody.

                                  M 1 Reply Last reply
                                  0
                                  • P Paul Selormey

                                    What is the real picture here? We have a project to create a Gantt control. The data format is still not done, and so I have decided to create a sample data format for testing (I am working on the main control). So, I downloaded Java application GanttProject and created a sample. With the sample project created, the Java application is shown 3 MB memory usage. For my incomplete control placed on a Windows forms with no data loaded, it is about 20 MB memory usage! What is the real stats here? anyone? Best regards, Paul.

                                    Jesus Christ is LOVE! Please tell somebody.

                                    M Offline
                                    M Offline
                                    Mattia Locatelli
                                    wrote on last edited by
                                    #17

                                    hi, we have had the same problems explaining this to the marketing team of a company we were developing an application for. They main reason is .NET allocates more space than the space really needed by the application to optimize performance, plus the memory footprint you see contain also some shared components of the framework. What you see is called the working size of the process if I remeber well (project was 3 years ago) and is not a good indicator of the memory footprint of the process. Said this, I think if you develop an application for windows, you should use .NET, but I don't want to start a flame. By the way, the solution to make the marketing team happy was, with their approval, to have a thread trim the working size each 5 seconds so in task manager the memory footprint was not high :doh: . Crazy what you have to do sometime!

                                    C 1 Reply Last reply
                                    0
                                    • M Mattia Locatelli

                                      hi, we have had the same problems explaining this to the marketing team of a company we were developing an application for. They main reason is .NET allocates more space than the space really needed by the application to optimize performance, plus the memory footprint you see contain also some shared components of the framework. What you see is called the working size of the process if I remeber well (project was 3 years ago) and is not a good indicator of the memory footprint of the process. Said this, I think if you develop an application for windows, you should use .NET, but I don't want to start a flame. By the way, the solution to make the marketing team happy was, with their approval, to have a thread trim the working size each 5 seconds so in task manager the memory footprint was not high :doh: . Crazy what you have to do sometime!

                                      C Offline
                                      C Offline
                                      CurtainDog
                                      wrote on last edited by
                                      #18

                                      Agreed. Profile the app, if the results seem reasonable then I wouldn't worry about what the task manager reports. If the OS is having no problems giving resources to the app then it may just be there are a lot of objects waiting to be deleted but no real need to do garbage collection.

                                      1 Reply Last reply
                                      0
                                      • P Paul Selormey

                                        Joaquim Rendeiro wrote:

                                        Might it be that the Java app is drawing everything with custom paint logic and your .net app uses a lot of controls?

                                        The applications are similar, list/grid, splitter and gantt chart view. The Java app has toolbar, menu and status bar, dialogs etc (a complete application). The .NET app is just started, no dialog etc and does no real drawing yet. Best regards, Paul.

                                        Jesus Christ is LOVE! Please tell somebody.

                                        M Offline
                                        M Offline
                                        Member 4208399
                                        wrote on last edited by
                                        #19

                                        From experience I will tell you we created a Java application to handle routing for us (integrated with a logistic company's software) and it required massive tweaks to run on the client computer due to memory usage (and even then still often failed). The same .NET app required no tweaks and worked as we coded it. I'm certainly no expert in either technology.

                                        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