SShortSingh.
Back to feed

Why scene.remove() Does Not Free GPU Memory in Three.js and How to Fix It

0
·1 views

Removing a mesh from a Three.js scene graph does not release the underlying GPU resources such as vertex buffers, textures, and compiled shaders, which must be freed explicitly. Developers need to call dispose() separately on the geometry, each material, and every texture a material references, since material.dispose() alone does not clear texture uploads. Entire object hierarchies, render targets, post-processing composers, and OrbitControls each require their own dispose() calls to prevent cumulative memory leaks. Browsers typically allow only around 16 WebGL contexts per page, so failing to dispose the renderer itself in single-page apps can eventually cause a blank canvas error. Three.js exposes renderer.info.memory to track active geometries and textures, offering a straightforward way to confirm whether resources are returning to baseline after a scene teardown.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Solo dev's Claude UI project hits 2.4K stars, now building paid hosted version

A developer launched HolyClaude in March as an open-source, MIT-licensed web UI for running Anthropic's Claude AI locally, and the project has since grown to 2,478 stars and 257 forks with around 132,000 combined Docker pulls across two projects. The tool's local-only design created a practical problem: long-running AI agent tasks would fail whenever the developer closed their laptop or stepped away. To solve this, the developer is now building a hosted version that gives each user a dedicated Firecracker VM on Fly.io with persistent storage, pre-installed agent CLIs, and SSH access, all using the user's own API key. There is no free tier because each VM costs roughly $13 per month regardless of usage, a cost structure the developer describes as fundamentally different from typical software businesses. Some features, including multi-user login and SSO, will arrive on the hosted version first due to a dependency on a third-party UI component in the open-source build, not for commercial reasons.

0
ProgrammingDEV Community ·

Default NLP Stop-Word Lists Can Break Voice Smart-Home Commands

A common NLP preprocessing step — stripping stop-words — can silently cripple voice-controlled smart-home systems by discarding critical command words like 'on', 'off', and 'all'. Standard stop-word lists treat these as meaningless noise, but in commands such as 'turn on light two', they carry the entire instruction. When filtered out, 'turn on' and 'turn off' reduce to identical tokens, causing the system to toggle the wrong switch unpredictably. The fix is minimal: simply remove the relevant words from the stop-word set before filtering is applied. The episode highlights a broader engineering caution — default library settings encode assumptions that may not suit every domain, and developers must override them when context demands it.

0
ProgrammingHacker News ·

Researcher Explores Extreme DRAM Manipulation in New Technical Project

A technical project titled 'Skitter Creek Bath Salts' has been shared on GitHub by user xoreaxeaxeax, known for unconventional low-level computing research. The project appears to explore extreme or unusual manipulation of DRAM (Dynamic Random-Access Memory). The submission was posted to Hacker News under the informal title 'Spaghettifying DRAM,' suggesting a focus on stretching or distorting memory behavior in unexpected ways. At the time of reporting, the post had received 3 points and no comments. Limited publicly available details make it difficult to fully assess the project's scope or findings without reviewing the repository directly.

0
ProgrammingDEV Community ·

Agentic RAG Lets AI Models Control When and How They Retrieve Information

Agentic RAG is an evolution of retrieval-augmented generation (RAG) in which the AI agent — rather than a fixed pipeline — decides when to retrieve data, how to frame the query, and whether the returned results are adequate. Unlike classic RAG, which embeds a user's question, fetches top results once, and passes them directly to the model, agentic RAG treats retrieval as a repeatable tool the model can call multiple times until it has sufficient context. The agent can rewrite queries, judge the relevance of results, switch between different data sources such as vector indexes, SQL databases, or APIs, and retry searches before generating a final answer. This added flexibility improves recall and handles complex, multi-step questions better than a linear pipeline, but comes at the cost of higher latency and less predictable compute usage. Classic RAG remains the more efficient choice for straightforward lookups over a single corpus, and the agentic approach is best reserved for scenarios where retrieval quality genuinely needs dynamic oversight.