Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by mattbell · Aug 24, 2012 at 10:45 PM · texture2dmemorysysteminfo

How do I know if there's enough graphics card memory to allocate a new texture?

I'm creating a Unity Web program that is texture-heavy and may be opened in multiple browser tabs at once. Thus, the total amount of graphics card memory required is large and unpredictable.

I want to know during the program's operation if loading additional textures will cause the application to run out of texture memory. (The user would then be prompted to close other viewers that are using a lot of texture memory or the program may down-res the textures it is planning on loading)

Things I have tried:

  • Creating the texture2D and then catching an exception if it fails. This doesn't appear to work; an OutOfMemoryException is thrown, but the program crashes prior to the return of the "new texture2D" call.

  • Using SystemInfo.graphicsMemorySize() (http://docs.unity3d.com/Documentation/ScriptReference/SystemInfo-graphicsMemorySize.html). Unfortunately this would only work if the user is not running other 3D content -- since it only reports the total texture memory, the program does not know how much is already allocated. In our case, several instances of our viewer are often running simultaneously.

Possible approaches:

  • Is there another way of directly allocating texture memory in a more recoverable way so that I can test-allocate the texture memory prior to allocating the texture2D?

  • Is there a way that I can detect (directly or indirectly) when the system is close to running out of texture memory?

  • Is there a relatively easy way for all instances of our viewer in different browser tabs to talk to each other locally? Then, each instance can share how much memory it is using, and (presuming there is not other 3D content running) the program can arrive at an estimate of total texture memory used.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Screenshot on windows phone increase memory why? 1 Answer

Profiler has HideFlags.DontSave Assets taking up 86mb [What is this?] 1 Answer

Texture and Texture2D for GUI (simple question) 1 Answer

how do you destroy a texture2d array ? 3 Answers

When is a referenced texture actually loaded? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges