Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Just got to work and got the same error that Jorge Eduardo Perez Perez got on Windoze. I'll see if it is something I can track down quickly/easily enough to resolve things.

    Comment


    • #17
      Not sure what is happening, but I think it may be related to the .pkg file on the github pages site. When I tried installing it on my Ubuntu box at home I had the same issue, but when I looked in the directory the jar file hadn't been installed. When I copied the .jar file to the directory manually it worked with out any issues. I might need to sandwich the jar between a helpfile and the .ado or something strange like that:

      Code:
      . about
      
      Stata/MP 14.0 for Unix (Linux 64-bit x86-64)
      Revision 05 May 2015
      Copyright 1985-2015 StataCorp LP
      
      Total usable memory:   15.68 GB
      
      . di `"`c(os)'"'
      Unix
      
      . copy https://wbuchanan.github.io/StataOS/sysresources.jar /home/billy/ado/plus/s/
      > sysresources.jar
      
      . sysresources, d
      Total committed memory is : 3.5 GiB
      Free Swap Space is : 232.8 GiB
      Total Available Swap Space is : 232.8 GiB
      Process CPU Time is : 1620000000
      Free Physical Memory Available is : 14.0 GiB
      Total Physical Memory Available is : 15.7 GiB
      System CPU Load is : 0.009824099534745997
      Process Load is : 5.750318406133844E-6
      % Free Physical Memory is : 89.32899319648742
      It might be something where it isn't loading the jar on your side as well, or it may not be looking for it in a jar subdirectory instead of the directory where the ado file resides.

      Comment


      • #18
        Current version is working on both of my systems. Amazing, thanks!
        Jorge Eduardo Pérez Pérez
        www.jorgeperezperez.com

        Comment


        • #19
          Jorge Eduardo Perez Perez Cool glad to hear it. I threw a help file in just to see if that was potentially related and was able to test it successfully on my Mac, but it failed again on my Linux machine this morning (but that may be more an issue with permissions than anything).

          Comment


          • #20
            eric_a_booth Thank you for the help with file read. I think I'll just switch to sysresources now, but your code helped me learn about how file read works.
            Jorge Eduardo Pérez Pérez
            www.jorgeperezperez.com

            Comment


            • #21
              I have been using sysresources successfully for a while now, but now there's a lot of disk caching going on in the server. sysresources can not see the cached memory, only the physical memory and the swap space. This means that sometimes my processes stop because of lack of available physical memory, while in fact they could grab it from the cache and start. Is there a chance you could update sysresources to also return the cached memory?

              Thanks again.

              Jorge Eduardo Pérez Pérez
              www.jorgeperezperez.com

              Comment


              • #22
                Jorge Eduardo Perez Perez I'll try to see if I can find a way to get the cached memory from the system as well. If I can I'll definitely add it. If you wouldn't mind, though, submit this as an issue to the project repository. It helps me to keep track of and manage my queue and also provides a bit of information about what drove any changes/updates.

                Comment


                • #23
                  Sure I'll post it there. Thank you!
                  Jorge Eduardo Pérez Pérez
                  www.jorgeperezperez.com

                  Comment


                  • #24
                    Jorge Eduardo Perez Perez not a problem. Glad it has been helpful.

                    Comment


                    • #25
                      The program has been updated and the addition basically acts like the shell or ! command, but returns the result in local macros. So the syntax would look something like :

                      Code:
                       
                      sysresources vm_stat
                      With no other options (which I still need to document), it will attempt to parse the lines from stdout into key value pairs defined by multiple repeated white space characters, and will then attempt cleaning the key and value elements (e.g., trimming the keys to 32 characters and replacing any spaces with underscores). The set up right now means that things are fairly OS dependent, but also means you could do things that are more familiar from the command line (e.g., grepping output from the top command) as well. I'll probably make the default behavior return the individual lines from stdout without any processing, but there is also a macro that returns the raw results that you could parse separately if you wanted. There's an example of what the return values look like on OSX on the project page and in the README file in the repository.

                      Comment


                      • #26
                        eric_a_booth can you try running:

                        Code:
                        ado, find(sysresources)
                        Just to make sure there isn't a second copy floating around somewhere. I actually just broke things out a bit more and was getting ready to push the changes this morning (e.g., the modification mentioned by Jorge Eduardo Perez Perez will now be contained in a separate command called clicmd which can be used more generally to make calls to the shell and get the results returned back into Stata). As an example based on Jorge Eduardo Perez Perez's request, this is the closest thing I could find for OSX and the command itself is ported from Unix so it should satisfy the need (assuming Jorge Eduardo Perez Perez is a bit more familiar with the man page entry and language in the entry than I am [not sure which of the entries would show the cached memory but could guess]):

                        Code:
                        . query java
                        ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
                            Java system information
                              Java initialized     no
                            Advanced Java settings
                              set java_heapinit    256m
                              set java_heapmax     1024m
                              set java_vmpath      /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/server/libjvm.dylib
                        
                        . clicmd vm_stat, d par cl
                        -------------------------------------------------------------------------------------
                               Key                                       Value
                        -------------------------------------------------------------------------------------
                               parser                                    ((.*)(\s{1,}+)(.*))
                               cleaner                                   (^([\w _]{1,}+)(\W{1,}.*)$)
                               pgroups                                   2, 4
                               clgroups                                  2, 4
                               exec                                      vm_stat
                               pages_speculative                         240936
                               decompressions                            1303219
                               pages_throttled                           0
                               pages_free                                766219
                               pages_zero_filled                         49374799
                               pages_inactive                            308984
                               anonymous_pages                           2017674
                               pageins                                   2249428
                               pages_wired_down                          438923
                               pages_copy                                1142861
                               pages_reactivated                         2496
                               compressions                              2208017
                               swapouts                                  0
                               pageouts                                  0
                               pages_active                              2121365
                               pages_stored_in_compressor                633903
                               translation_faults                        65140216
                               pages_occupied_by_compressor              316462
                               pages_purgeable                           530933
                               swapins                                   0
                               file                                      653611
                               mach_virtual_memory_statistics            bytes
                               pages_purged                              354377
                        -------------------------------------------------------------------------------------
                        
                        . ret li
                        
                        macros:
                               r(pages_purged) : "354377"
                          r(mach_virtual_memo
                            ry_statistics)     : "bytes"
                                       r(file) : "653611"
                                    r(swapins) : "0"
                            r(pages_purgeable) : "530933"
                          r(pages_occupied_by
                            _compressor)       : "316462"
                          r(translation_fault
                            s)                 : "65140216"
                          r(pages_stored_in_c
                            ompressor)         : "633903"
                               r(pages_active) : "2121365"
                                   r(pageouts) : "0"
                                   r(swapouts) : "0"
                               r(compressions) : "2208017"
                          r(pages_reactivated) : "2496"
                                 r(pages_copy) : "1142861"
                           r(pages_wired_down) : "438923"
                                    r(pageins) : "2249428"
                            r(anonymous_pages) : "2017674"
                             r(pages_inactive) : "308984"
                          r(pages_zero_filled) : "49374799"
                                 r(pages_free) : "766219"
                            r(pages_throttled) : "0"
                             r(decompressions) : "1303219"
                          r(pages_speculative) : "240936"
                                       r(exec) : "vm_stat"
                                        r(raw) : "Mach Virtual Memory Statistics: (page size of 4096 bytes)Pages free:                              766219.Pages active:                       .."
                                   r(clgroups) : "2, 4"
                                    r(pgroups) : "2, 4"
                                    r(cleaner) : "(^([\w _]{1,}+)(\W{1,}.*)$)"
                                     r(parser) : "((.*)(\s{1,}+)(.*))"
                        Without any regular expressions being passed it will try to split things into key-value pairs and return the regular expressions used to do that (e.g., r(cleaner), r(parser), r(clgroups), and r(pgroups)). Right now it's primarily useful for cases where the command is a single string without spaces, but I'll continue looking into ways to pass options/flags and arguments to the commands in a way that Java doesn't complain too much. If the parse/clean options are not turned on, the data will be returned in macros defined by the line number of the output:

                        Code:
                        . clicmd vm_stat, d
                        -------------------------------------------------------------------------------------
                               Key                                       Value
                        -------------------------------------------------------------------------------------
                               parser                                    .*
                               cleaner                                   .*
                               pgroups                                   0, 0
                               clgroups                                  0, 0
                               exec                                      vm_stat
                               line7                                     Pages wired down:  439638.
                               line6                                     Pages throttled:  0.
                               line5                                     Pages speculative:  240948.
                               line4                                     Pages inactive:  309258.
                               line9                                     Translation faults:  65247729.
                               line8                                     Pages purgeable:  530933.
                               line13                                    Pages purged:  354377.
                               line14                                    File-backed pages:  653627.
                               line11                                    Pages zero filled:  49473281.
                               line22                                    Swapins:  0.
                               line12                                    Pages reactivated:  2496.
                               line23                                    Swapouts:  0.
                               line20                                    Pageins:  2249428.
                               line10                                    Pages copy-on-write:  1143452.
                               line21                                    Pageouts:  0.
                               line19                                    Compressions:  2208017.
                               line3                                     Pages active:  2129271.
                               line17                                    Pages occupied by compressor:  316452.
                               line2                                     Pages free:  756423.
                               line18                                    Decompressions:  1303239.
                               line1                                     Mach Virtual Memory Statistics: (page size of 4096 bytes)
                               line15                                    Anonymous pages:  2025850.
                               line16                                    Pages stored in compressor:  633883.
                        -------------------------------------------------------------------------------------

                        Comment


                        • #27
                          eric_a_booth you should be able to download/install the newest version from the same site you were using.

                          Comment

                          Working...
                          X