+ Reply to Thread
Results 1 to 10 of 10

Thread: Free memory without restarting CityEngine!!

  1. #1
    gou zhun
    Join Date
    Nov 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Free memory without restarting CityEngine!!

    Hello,

    I've been working a lot in CityEngine recently, testing out many difference grammar files on the same lot. I've noticed that as I continue doing this, the free memory slowly drops.

    I'm just using the one lot, and only have one model on the screen at any given time.

    Is there a way to free up this memory without having to restart CityEngine?

  2. #2
    Matthias Buehler

    Join Date
    Oct 2011
    Posts
    1,052
    Points
    316
    Answers Provided
    77


    0

    Default Re: Free memory without restarting CityEngine!!

    Hi Gou !


    Can you tell me precisely what OS you are using (amount of RAM / 32|64 bit / ..) ?

    The CityEngine caches (keeps in memory) assets and textures, thus it may be if you are frequently exchanging assets that your memory decreases. What may also help you is to delete from time to time the existing models via RMB > Delete Models.

    Did you see the recommended (and minimum) system requirements here ?
    http://resources.arcgis.com/content/...m-requirements

    Please let me know.
    _________________

    CityEngine Machinist

    * YOUTUBE CHANNEL : www.youtube.com/channel/UCNS4TLgToEDQiH9pi06ofOA
    * tutorial videos : http://forums.arcgis.com/threads/648...URCES-FAQ-HELP
    * Please use the rating buttons on the right side !

  3. #3
    gou zhun
    Join Date
    Nov 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Free memory without restarting CityEngine!!

    Quote Originally Posted by matthiasBuehler View Post
    Hi Gou !


    Can you tell me precisely what OS you are using (amount of RAM / 32|64 bit / ..) ?

    The CityEngine caches (keeps in memory) assets and textures, thus it may be if you are frequently exchanging assets that your memory decreases. What may also help you is to delete from time to time the existing models via RMB > Delete Models.

    Did you see the recommended (and minimum) system requirements here ?
    http://resources.arcgis.com/content/...m-requirements

    Please let me know.
    HI,Matthias
    Thx for replying! My OS is higher than the Software Requirements and Recommendations .I've been working a lot in CityEngine recently,So what you said I have tried,but NOT working!
    I did it by a Python Script which batch exporting my models,Here is the script!
    Code:
    import os,sys
    
    def list_file(rootpath):
        i=0
        for path in os.listdir(rootpath):
            absolutepath=os.path.join(rootpath,path)
            if os.path.isdir(absolutepath):
                list_file(absolutepath)
            else:
                if os.path.splitext(path)[1][1:] =="shp":
                    ImportAndGenerate(rootpath+"\\"+path,i,path[0:3])
                    i=i+1
    def ImportAndGenerate(pathstr,i,path):
        ce.importFile(pathstr, settings)
        object = ce.getObjectsFrom(ce.scene, ce.withName("'Shapefile Lot'"))
    
        ce.setSelection(object)
        ce.setStartRule(ce.selection, "Lot")
    #object=ce.getObjectsFrom(ce.selection)
        ce.setRuleFile(ce.selection, "rules\ForExport\GroundFLoorExport.cga")
        #ce.generateModels(object)
        #ce.saveFile("rt.cej")
        #ce.generateModels(object)
        Export(object,path+str(i))
        
    def Export(object,Namestr):
        
    
        exportPath = ce.toFSPath("models/")
        exportSettings = A3DSExportModelSettings()
        exportSettings.setGranularityFile(A3DSExportModelSettings.PER_INITIAL_SHAPE)
        exportSettings.setGeneralLocation(exportPath)
        exportSettings.setGeneralName(Namestr)
        ce.export(object, exportSettings)
        ce.delete(ce.getObjectsFrom(ce.scene))
    
    
    
    
    
    
    if __name__ == '__main__':
        ce.newFile("rt.cej")
        ce.openFile("rt.cej")
        settings=SHPImportSettings()
        settings.setProjection(SHPImportSettings.DisableProjection)
        list_file('E:\\cityOP\\TDMap\\data\\OUT')
    Any problem with it!?

  4. #4
    Matthias Buehler

    Join Date
    Oct 2011
    Posts
    1,052
    Points
    316
    Answers Provided
    77


    0

    Default Re: Free memory without restarting CityEngine!!

    hi !

    I was not aware you're working with the Exporter. I asked one of the devs and it seems there may be some sort of mem leak in the Exporter, especially when called multiple times in a batch process.

    We're aware of the issue and try to fix this asap.
    _________________

    CityEngine Machinist

    * YOUTUBE CHANNEL : www.youtube.com/channel/UCNS4TLgToEDQiH9pi06ofOA
    * tutorial videos : http://forums.arcgis.com/threads/648...URCES-FAQ-HELP
    * Please use the rating buttons on the right side !

  5. #5
    gou zhun
    Join Date
    Nov 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Free memory without restarting CityEngine!!

    OK,Thx!
    The 2011.1 release had solved this problem,Right??

  6. #6
    Matthias Buehler

    Join Date
    Oct 2011
    Posts
    1,052
    Points
    316
    Answers Provided
    77


    0

    Default Re: Free memory without restarting CityEngine!!

    hi.

    for 2011.1, we have indeed fixed a mem leak, but not sure if it's your one.

    if you're on 2010.3, go to preferences/general/grammar core and disable the RCP Logger.

    does this help ?

    let me know.
    _________________

    CityEngine Machinist

    * YOUTUBE CHANNEL : www.youtube.com/channel/UCNS4TLgToEDQiH9pi06ofOA
    * tutorial videos : http://forums.arcgis.com/threads/648...URCES-FAQ-HELP
    * Please use the rating buttons on the right side !

  7. #7
    gou zhun
    Join Date
    Nov 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Free memory without restarting CityEngine!!

    Hi,Matthias!
    I have disabled the RCP Logger ,but still memory leak!

  8. #8
    Matthias Buehler

    Join Date
    Oct 2011
    Posts
    1,052
    Points
    316
    Answers Provided
    77


    0

    Default Re: Free memory without restarting CityEngine!!

    hi !

    is it possible that you prepare me a little simplified CE project which let's me reproduce the issue here , click-n-go style .. ?

    please send it to me directly (matthias.buehler@procedural.com) ?

    & please let me know which precise OS you're working on.
    Last edited by matthiasbuehler; 12-07-2011 at 05:32 AM.
    _________________

    CityEngine Machinist

    * YOUTUBE CHANNEL : www.youtube.com/channel/UCNS4TLgToEDQiH9pi06ofOA
    * tutorial videos : http://forums.arcgis.com/threads/648...URCES-FAQ-HELP
    * Please use the rating buttons on the right side !

  9. #9
    Simon Haegler
    Join Date
    Nov 2011
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

    Default Re: Free memory without restarting CityEngine!!

    hi

    we have analyzed your shapefiles and scripts. there are two things to note:

    1) CityEngine uses the java memory management. this means that CityEngine can allocate up to a certain amount of memory for all scene objects. this is specified in CityEngine.ini with the "-Xmx700M" switch. only when this amount is filled up, the java garbage collector will start to remove unused memory, for example when the python script imports another shape file.

    this explains the behaviour you see on your system: although your memory indicator shows that CityEngine has used a lot of memory, it is still available inside CityEngine for further operations.
    note that models generated by CGA and the model exporter operate outside the java memory.

    2) in CityEngine 2010.3 and CityEngine 2011 there is indeed a memory leak when a scene is closed or a new scene is created. we have logged the issue and will try to fix it for the next service release.

    we are sorry for the inconvenience.

    kind regards,
    simon
    Simon Haegler
    Esri R&D Center Zurich

  10. #10
    gou zhun
    Join Date
    Nov 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Free memory without restarting CityEngine!!

    Quote Originally Posted by shaegler View Post
    hi

    we have analyzed your shapefiles and scripts. there are two things to note:

    1) CityEngine uses the java memory management. this means that CityEngine can allocate up to a certain amount of memory for all scene objects. this is specified in CityEngine.ini with the "-Xmx700M" switch. only when this amount is filled up, the java garbage collector will start to remove unused memory, for example when the python script imports another shape file.

    this explains the behaviour you see on your system: although your memory indicator shows that CityEngine has used a lot of memory, it is still available inside CityEngine for further operations.
    note that models generated by CGA and the model exporter operate outside the java memory.

    2) in CityEngine 2010.3 and CityEngine 2011 there is indeed a memory leak when a scene is closed or a new scene is created. we have logged the issue and will try to fix it for the next service release.

    we are sorry for the inconvenience.

    kind regards,
    simon
    Hi,Simon!
    The memory LEAK really makes me upset,hoping you fix it asap!

    gouzhun

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts