Closed Bug 21329 Opened 25 years ago Closed 24 years ago

Image cache needs to limit number as well as size of the image resources consumed on WIN95/WIN98

Categories

(Core :: Graphics: ImageLib, defect, P1)

x86
Windows 98
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: kmcclusk, Assigned: neeti)

Details

Since WIN95/WIN98 has an absolute limit on the number of handles that can be
allocated we need to query the system to tell if resources are getting low when
deciding how many images can be placed in the image cache.

The short term solution was to restrict the cache to 1Mb instead of 2Mb. Even
with the 1Mb limit it would be possible to use up all of the available handles
if the images are small.
Status: NEW → ASSIGNED
Target Milestone: M14
Target Milestone: M14 → M15
Changing priority to P1.
Priority: P3 → P1
Reassigning to Neeti
Assignee: pnunn → neeti
Status: ASSIGNED → NEW
Status: NEW → ASSIGNED
Kevin,

The image cache is a list of containers. If the system is running low on file 
handles, reducing the number of images in the image cache would only free up 
some memory, but will not increase the file handles available. Could you clarify 
how the limiting the number of images in the image cache would conserve the file 
handles.

Thanks,
Neeti
Sorry, I should have clarified that it isn't the file handles that we run out 
of, its the HBITMAP handle's held in nsImageWin. Limiting the number of 
nsImageWin's that are around at a time would insure that will not run out of GDI 
resources because we are consuming too many HBITMAP's.
Kevin,
Is there an api in gfx which imagelib could query to find out the 
1. Number of HBITMAPS currently allocated.
2. Total number of HTBITMAPS which can be allocated.
or
Is there an api in gfx which tell us when we running out of HBITMAPS?
or 
If we can find out the MAX number of HBITMAPS which can be allocated, then we 
can limit the number of items(containers)in the cache to be always less than 
that number.

Neeti
Target Milestone: M15 → M16
Checked in a fix
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
I'm reopening this bug.  I think this restriction should only apply to Win98/95 
platforms.  The fix applied looks like it applies to all platforms.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Checked in fix, to make the restriction on the number of items in cache only on 
windows.
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → FIXED
Kevin, this looks impossible to verify reasonably using black box methods. Are
you okay with the fix, or should I rubber-stamp it as verified without inspection?

Thanks!
Go ahead and rubberstamp it based on neeti@netscape.com comments.
Rubber-stamped as verififed. Thanks, Kevin!
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.