Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7903481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:45:47+00:00 2026-06-03T09:45:47+00:00

I’m running my PlayN-game in the browser. In my task manager I see how

  • 0

I’m running my PlayN-game in the browser. In my task manager I see how the memory of google chrome or firefox is getting bigger and bigger up to 512 MB.

The probable reason is that I don’t clean up and destroy all my elements that I use in playn.
I didn’t clean up anything since the GarbageCollector was doing that in java for me and I didn’t think about getting problems in HTML5.

So what is the easiest way to clean up everything (IFaces, Layers, Images…) after using it?

Can I just destroy the iface or the top layer and PlayN destroys all subelements for me?
If I destroy an ImageLayer, the underlying Image is probably not destroyed, right?

Sorry for the unspecific question. I only need to understand the general concept and best practices for it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T09:45:48+00:00Added an answer on June 3, 2026 at 9:45 am

    For the most part, the only thing you need to do is not retain references to objects that you no longer need. Garbage collection will take care of the rest for you.

    You can call Layer.destroy to potentially speed up the freeing of GPU memory, but even that will be freed when the handles are garbage collected. In TriplePlay UI, Interface.destroyRoot removes the root from the UI (which you need to do if you’re going to keep the Interface around but no longer need that root) and destroy’s the root’s layer.

    The problem you may be running into is that the HTML backend currently caches all assets for the lifetime of your game. So if you load a lot of images or other data, that will eventually use a lot of browser memory. Any given image will not be loaded more than once, but perhaps you have a lot of images in your game.

    I’ll be changing this cache-whether-you-like-it-or-not policy before the next PlayN release, so you’ll have to cache images on your own if you need them cached, but at least you will also be able to free them when you need to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm making a simple page using Google Maps API 3. My first. One marker
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.