為什麼將一個大的影象複製到剪貼簿會凍結一臺計算機?

有時,當使用我們的電腦時,會發生一些非常奇怪的事情,完全沒有意義……比如把一個簡單的影象複製到剪貼簿上,電腦就因此凍結了。影象就是影象,對嗎?今天的超級使用者帖子回答了一個困惑讀者的難題。...

為什麼將一個大的影象複製到剪貼簿會凍結一臺計算機?

有時,當使用我們的電腦時,會發生一些非常奇怪的事情,完全沒有意義……比如把一個簡單的影象複製到剪貼簿上,電腦就因此凍結了。影象就是影象,對嗎?今天的超級使用者帖子回答了一個困惑讀者的難題。

今天的問答環節是由SuperUser提供的,SuperUser是Stack Exchange的一個分支,是一個由社群驅動的問答網站分組。

原始影象由維基媒體提供。

問題

超級使用者讀者Joban Dhillon想知道為什麼將影象複製到他電腦上的剪貼簿會使其凍結:

I was messing around with some height map images and found this one:

(http://upload.wikimedia.org/*********/comm***/1/15/Srtm_ramp2.world.21600×10800.jpg)

007Ys3FFgy1gpfjbv7dgaj30dw06yjrj

The image is 21,600*10,800 pixels in size. When I right click and select “Copy Image” in my browser (I am using Google Chrome), it slows down my computer until it freezes. After that I must restart. I am curious about why this happens. I presume it is the size of the image, although it is only about 6 MB when saved to my computer. I am also using Windows 8.1

為什麼一個簡單的影象在複製到剪貼簿後會凍結Joban的電腦?

答案

超級使用者貢獻者Mokubai為我們提供了答案:

“Copy Image” is copying the raw image data, rather than the image file itself, to your clipboard.

The raw image data will be 21,600 x 10,800 x 3 (24 bit image) = 699,840,000 bytes of data. That is approximately 700 MB of data your browser is trying to copy to the clipboard.

JPEG compresses the raw data using a lossy algorithm and can get pretty good compression. Hence the compressed file is only 6 MB.

The reason it makes your computer slow is that it is probably filling your memory up with at least the 700 MB of image data that your browser is using to show you the image, another 700 MB (along with whatever overhead the clipboard incurs) to store it on the clipboard, and a not insignificant amount of processing power to convert the image into a format that can be stored on the clipboard.

Chances are that if you have less than 4 GB of physical RAM, then those copies of the image data are forcing your computer to page memory out to the swap file in an attempt to fulfill both memory demands at the same time. This will cause programs and disk access to be sluggish as they use the disk and try to use the data that may have just been paged out.

In short: Do not use the clipboard for huge images unless you have a lot of memory and a bit of time to spare.

Like pretty graphs? This is what happens when I load that image in Google Chrome, then copy it to the clipboard on my machine with 12 GB of RAM:

007Ys3FFgy1gpfjbvts3hj30ce0djaak

It starts off at the lower point using 2.8 GB of RAM, loading the image punches it up to 3.6 GB (approximately the 700 MB), then copying it to the clipboard spikes way up there at 6.3 GB of RAM before settling back down at the 4.5-ish you would expect to see for a program and two copies of a rather large image.

That is a whopping 3.7 GB of image data being worked on at the peak, which is probably the initial image, a reserved quantity for the clipboard, and perhaps a couple of conversion buffers. That is enough to bring any machine with less than 8 GB of RAM to its knees.

Strangely, doing the same thing in Firefox just copies the image file rather than the image data (without the scary memory surge).


有什麼要補充的解釋嗎?在評論中發出聲音。想從其他精通技術的Stack Exchange使用者那裡瞭解更多答案嗎?在這裡檢視完整的討論主題。

  • 發表於 2021-04-11 09:13
  • 閱讀 ( 30 )
  • 分類:網際網路

你可能感興趣的文章

如何在mac和windows之間同步剪貼簿

你有沒有想過可以在一個裝置上覆制一些東西,然後直接貼上到另一個裝置上?macossierra為iPhone使用者提供了自動剪貼簿,而且在Windows和Android之間共享剪貼簿也很容易。 ...

  • 發佈於 2021-03-12 18:06
  • 閲讀 ( 56 )

知道何時ctrl+c無法使用此通知程式應用程式複製到剪貼簿

如果有一個鍵盤快捷鍵是每個Windows使用者都應該知道的,那就是Ctrl+C。它可以讓你在瞬間將任何東西複製到剪貼簿上,並使在應用程式之間移動文字和影象變得輕而易舉。 ...

  • 發佈於 2021-03-13 00:33
  • 閲讀 ( 29 )

你需要一個剪貼簿管理器替代品

... 當前剪貼簿有什麼問題? ...

  • 發佈於 2021-03-16 22:56
  • 閲讀 ( 56 )

如何在mac上覆制和貼上

...快捷鍵。如果您確定永遠不會使用原始的“貼上”命令,為什麼不重新使用它的快捷方式來複制和貼上文字而每次都不格式化呢? ...

  • 發佈於 2021-03-20 10:54
  • 閲讀 ( 58 )

新的Windows10剪貼簿:複製貼上所需的一切

...你想傳輸到另一臺計算機上的東西時,你不必將它貼上到一個檔案中,然後使用雲服務(如Dropbox或OneDrive)傳輸該檔案,甚至不必使用USB快閃記憶體驅動器將其傳輸到sneaker net。 ...

  • 發佈於 2021-03-22 16:53
  • 閲讀 ( 59 )

微軟正在為edge測試一個web裁剪工具

... 複製功能是一個特別受歡迎的功能。現在,即時訊息工具支援將影象直接貼上到聊天視窗中。 ...

  • 發佈於 2021-03-30 11:48
  • 閲讀 ( 44 )

如何快速將mac螢幕截圖複製到剪貼簿

...或者,也可以使用Cmd+N鍵盤快捷鍵。 螢幕截圖將顯示在一個新的預覽視窗中,您可以在其中以任何方式裁剪、註釋或編輯它。 相關:使用Mac的預覽應用來裁剪、調整大小、旋轉和編輯影象

  • 發佈於 2021-03-31 12:55
  • 閲讀 ( 51 )

為什麼iphone應用“從”其他應用“貼上”?

...個通知,通知您應用程式何時正在讀取剪貼簿的內容。 為什麼貼上是隱私問題 如果你正在將私人資料複製到剪貼簿,你可能沒有意識到你正在使用的應用程式可以從中讀取資料。例如,如果你複製一個密碼或信用卡號並切換到...

  • 發佈於 2021-04-01 12:08
  • 閲讀 ( 46 )

如何將檔案複製到Windows10上的usb快閃記憶體驅動器

...製的檔案 在保持USB驅動器視窗開啟的同時,按Ctrl+N開啟一個新的檔案資源管理器視窗。使用新視窗定位要複製的檔案。 找到檔案後,返回“這臺電腦”視窗,雙擊USB驅動器圖示將其開啟。你現在應該有兩扇窗戶並排開著。 接...

  • 發佈於 2021-04-01 18:27
  • 閲讀 ( 47 )

psa:所有的應用程式都可以讀取你的iphone和android剪貼簿

... pic.twitter.com/OSXP43t5SZ — Jeremy Burge (@jeremyburge) June 24, 2020 為什麼智慧**讓應用程式讀取剪貼簿? 當你將某些內容複製到剪貼簿時,應用程式可以讀取剪貼簿的內容,而無需手動選擇“貼上”。這是經過設計的。 例如,當你將追...

  • 發佈於 2021-04-02 00:52
  • 閲讀 ( 55 )
彤彤彤彤-
彤彤彤彤-

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦