Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Closed] Etcetera Plugin Live! Alerts, prompts, loading views, push, localization and more!

Discussion in 'iOS and tvOS' started by prime31, Oct 18, 2010.

  1. shadowfork

    shadowfork

    Joined:
    Jan 8, 2010
    Posts:
    167
    I used your example scene to load the url.

    As you can see, the idle state was around 10mb.

    When opening the web view, it went up to 42mb.

    Closing it came down only to 32mb.... 20++mb more from where it was initially.

    Any solution to free up/take back that memory?

    Screen Shot 2014-07-24 at 4.33.36 PM.png
     
  2. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Do you understand how iOS shared memory works? If not, please take the time to learn if you are profiling memory usage. When the web view is dismissed it is entirely released from memory (set a breakpoint in the code and see for yourself the release is called). Note that iOS will not lower the used memory utilized until memory is actually requested by an application. That is just the way memory works on iOS. If you just want to see the data in Instruments change than simply allocate a bunch of memory on the native side then release it. That will cause the OS to show the extra memory as released for a moment.
     
    Last edited: Jul 25, 2014
  3. shadowfork

    shadowfork

    Joined:
    Jan 8, 2010
    Posts:
    167
    No, I don't understand how iOS shared memory works. I'm sure I'm not the only one. Not all of us here are hardcore programmers. That's why we buy your stuff, so we don't have to worry coding natively.

    But thanks anyway for trying to explain it.
     
  4. jcarpay

    jcarpay

    Joined:
    Aug 15, 2008
    Posts:
    561
    Actually there is a way to improve this by disabling the caching feature of the UIWebView.
    This requires some modification of the etcetera plugin though.

    http://stackoverflow.com/questions/5468553/clearing-uiwebview-cache
     
  5. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    The NSURLCache is on on-disk cache. Clearing it won't help with memory much. Using memory is the best way to purge memory on iOS just like all those gimmick "free memory" apps work. They allocate a bunch of memory then deallocate it making it look like they increased available free memory when in fact they did nothing but change what the OS was reporting.
     
  6. ajaybhojani

    ajaybhojani

    Joined:
    Dec 3, 2013
    Posts:
    7
    hi prime....
    i am using etcetra pluging. it works awesome for camera photo. now i want take photo with current date and text displayed on it. how can it possible. please reply as soon as possible
     
  7. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    Hello there,

    I've just upgraded my project from 3.5 to 4.3, and also updated Prime31 to the latest version. However in the editor, and also on the iOS device i get the following error:

    ArgumentException: FindObjectsOfType can only be called from the main thread.
    Constructors and field initializers will be executed from the loading thread when loading a scene.
    Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
    UnityEngine.Object.FindObjectOfType (System.Type type)
    Prime31.AbstractManager.initialize (System.Type type)
    EtceteraManager..cctor () (at Assets/Plugins/Etcetera/EtceteraManager.cs:79)​

    It seems like the FindObjectOfType is happening inside the DLL, however AbstractManager.initialize is being called from a static constructor in EtceteraManager.

    Any clues on how to fix it? Static constructors often cause issues in Unity, perhaps i should call initialize myself in an Awake?
     
  8. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Important Note

    This thread has now had [CLOSED] added to the title. Ever since Unity's big forum upgrade the email notification system is very broken. We receive updates maybe 1 out of 10 times when a thread is updated. For that reason we are moving all support over to our support site: support.prime31.com where the email notification system is functioning properly which allows us to respond in a timely fashion.