简体   繁体   English

MediaPlayer内存消耗

[英]MediaPlayer memory consumption

In my android application I created three MediaPlayers 在我的android应用程序中,我创建了三个MediaPlayers

MediaPlayer mp1=new MediaPlayer();
MediaPlayer mp2=new MediaPlayer();
MediaPlayer mp3=new MediaPlayer();

now, my question is if I create an array in addition like: 现在,我的问题是我是否还要另外创建一个数组:

MediaPlayer mp[]={mp1,mp2,mp3};

does it takes up same memory size as the above 3 media players, or just put some references to mp1,2,3 in a small memory amount? 它是否占用了与上述3个媒体播放器相同的内存大小,或者只是以较小的内存量引用了mp1,2,3?

Also, if somebody knows, how much memory is allocated for one media player? 另外,如果有人知道,一个媒体播放器会分配多少内存?

The array only stores references to the MediaPlayer objects. 该数组仅存储对MediaPlayer对象的引用。 It (the array) probably takes about 20 bytes. 它(数组)大概需要20个字节。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM