473,757 Members | 5,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deleting a preloaded image from memory

How can I really delete a preloaded image from memory/disk cache? Let's
say I preload an image by creating an Image object and setting its src
attribute to desired URL:

var img = new Image();
img.src = [someurl];

Then I use the image a few more times by adding it into an Array
object:

var images = new Array();
images.push(img );

I found out that just calling 'delete' on a pointer to that Image
object, doesn't free up the RAM.

delete images[0]; //RAM is not freed here!

Should I call delete on all the references to the image object? This
would be a real pain, since I have to check about 3000 lines of code
for possible references to it and make sure I 'delete' all of them...
What about the other new Image objects, that get their src attribute
set to the same url?

May 17 '06
62 17849
Randy Webb wrote:
I have been plonked and un-plonked by him so many times I call myself
the President of the "Thomas called me a Troll" club.


If you would just read ECMA Specification version 15.43.24.5 section 5,
paragraph 4, you would know why.

Score adjusted

--
Matt Kruse
http://www.JavascriptToolbox.com
http://www.AjaxToolbox.com
May 26 '06 #61
Lasse Reichstein Nielsen wrote:
"Bart Van der Donck" <ba**@nijlen.co m> writes:
I'm not aware of any system that doesn't store RAM as binary digits,
and I'm not sure if this is überhaupt possible.


It's possible, and there were attempts in the early days of computers
to build decimal based computers. It just turned out to be too fragile.
Distinguishing between ten levels of voltage was more errorprone than
just between "on" and "off".

I believe both the Eniac and the Mark I were decimal.


The ASSC ("Mark I") was electromechanic al, and used odometer-like wheels.

IBM, at least, never made a decimal computer based on voltage
differences. All IBM decimal computers used binary encodings, including:

BCD: 0000 through 1001.
Excess-3: 0011 through 1100
Biquinary: five bits, only one 1, plus two bits, only one 1
Three-of-five: five bits, three 1, and two 0

IBM mainframes still normally use decimal arithmetic for financial
calculations, although binary is used for addressing and scientific
number crunching.

One Russian computer of the 50's used ternary (base-3).

--
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"
May 26 '06 #62
Bart Van der Donck wrote:
Thomas 'PointedEars' Lahn wrote:
[...]
You do not look very smart ignoring this very simple fact repeatedly,
while rambling and patronizing knowledgeable people about quite
irrelevant possible implementations of data storage in hardware.
Nuff said.


Play the ball, not the person, Thomas.


I am playing the ball. I am criticizing (your) evading behavior in
discussions that can be perceived as trolling, as it tries to keep
off-topic discussions alive by posting irrelevant facts and later
stating them as irrelevant repeatedly, while ignoring the real facts
presented, and not having the potential to provide a noticeable gain
to anyone (learning about what is troll behavior aside).
PointedEars
--
When the power of love overcomes the love
of power, the world will know peace.
-- Jimi Hendrix
May 26 '06 #63

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2008
by: TomA | last post by:
Hi All, I have a picturebox on a form containing the photo of a person. As you advance through the records, the photo updates. Rather than storing the images in an inefficient blob field in a table, I have the separate images stored in an image directory with primary key as the filename (3476.jpg). If the image exists, I display the image. All this works fine. I have a buttons that allow for the insertion and deletion of photos. ...
3
6507
by: vunet.us | last post by:
why am i unable to insert image background into a tr or td element in IE using preloaded image object, like this: var img = new Image(); img.src = 'blah.gif'; document.getElementById('someId').style.backgroundImage = "url('"+img.src+"')"; <table><tr id='someId'><td>content</td></tr></table>
0
9487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9904
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9735
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7285
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3828
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3395
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.