Announcement

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

  • Extension of maximum number of variables by "maxvar" is not possible:

    I have Stata 15 with a Stata/SE license. So extension of memory space should be possible. However using "set maxvar 8000" results in the following error message:

    Code:
     . set maxvar 8000
    no; data in memory would be lost
    My memory usage is currently:
    Code:
    . memory usage
    
      Memory usage
                                                used                allocated
        ---------------------------------------------------------------------
        data                              11,290,795               67,108,864
        strLs                                      0                        0
        ---------------------------------------------------------------------
        data & strLs                      11,290,795               67,108,864
    
        ---------------------------------------------------------------------
        data & strLs                      11,290,795               67,108,864
        var. names, %fmts, ...             1,750,469                2,762,465
        overhead                           1,081,344                1,082,136
    
        Stata matrices                             0                        0
        ado-files                                  0                        0
        stored results                             0                        0
    
        Mata matrices                              0                        0
        Mata functions                             0                        0
    
        set maxvar usage                   5,281,738                5,281,738
    
        other                              2,439,320                2,439,320
        ---------------------------------------------------------------------
        grand total                       20,441,286               78,674,523
    Has anybody an idea, why "set maxvar 8000" does not work?
    Thanks a lot!

  • #2
    At the time that you issued the set maxvar command you had a dataset in memory, and set maxvar is concerned - I believe - that it will cause that data to be cleared and possibly lose some of your work. So issue the set maxvar command when you have no data in memory.
    Code:
    clear
    set maxvar 8000

    Comment


    • #3
      I have already checked this possiblity. Unfortunately,
      Code:
       
        . set maxvar 8000 no; data in memory would be lost
      appears even after I have reloaded my database and without any other commands inbetween.

      Also, if I use "clear" all the variables in my database disappear. What could that be?

      Comment


      • #4
        Run the set maxvar command before you load your dataset while there is no dataset in memory.

        The clear command does exactly what is documented in the output of the help clear command - it removes the current dataset from memory. So the after set maxvar you need to reload the dataset.

        Comment


        • #5
          That worked! Thanks a lot! I thought "set maxvar" would always be related to a specific database. Now I understand that it changes the software configuration in general.

          I read the "maxvar" manual description but didn't get that. Thanks again!

          Comment


          • #6
            I thought "set maxvar" would always be related to a specific database. Now I understand that it changes the software configuration in general.
            Note that the change is for the duration of your Stata session and reverts to the previous value at the end of the session. As a user of Stata/SE I have permanently set maxvar at the maximum
            Code:
            set maxvar 32767, permanently
            and with my datasets have never encountered a lack-of-memory situation that would have been remedied by freeing some of the 38,830,849 bytes allocated as a consequence of this value of maxvar.

            Comment


            • #7
              Note that the change is for the duration of your Stata session and reverts to the previous value at the end of the session. As a user of Stata/SE I have permanently set maxvar at the maximum
              Thanks for this useful information! I would appreciate, if the Reference Manual would be a bit more explicit about such things.

              Comment

              Working...
              X