Posts

Post not yet marked as solved
1 Replies
229 Views
I wrote simple NSMutableData test project. I profiled with allocations instruments. It shows alloc1() total bytes are 55MB. But alloc1() only called once and alloced byte should be 1MB. I cannot find the reason of 55MB allocation in alloc1() Replace this code with fresh macOS App project on Xcode13. #import "ViewController.h" @implementation ViewController {     NSTimer *mTimer;     NSMutableData *mData1;     NSMutableData *mData2; } - (void)viewDidLoad {     [super viewDidLoad];     mData1 = nil;     mData2 = nil;     mTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self             selector:@selector(timer_cb) userInfo:nil repeats:YES]; } - (void) timer_cb {     if (mData1 == nil) {         [self alloc1];     }     if (mData2 == nil) {         [self alloc2];     }     [self copy1]; } - (void) alloc1 {     NSLog(@"alloc1");     mData1 = [NSMutableData dataWithCapacity:1024*1024]; } - (void) alloc2 {     NSLog(@"alloc2");     mData2 = [NSMutableData dataWithCapacity:1024*1024];     [mData2 resetBytesInRange:NSMakeRange(0, 1024*1024)]; } - (void) copy1 {     [mData1 replaceBytesInRange:NSMakeRange(0, 1024*1024) withBytes:mData2.bytes]; } @end
Posted
by Himadeus.
Last updated
.
Post not yet marked as solved
0 Replies
285 Views
I test with VLC as RTSP audio client on MacOS. Every 5 minutes, I hear noise. The noise continue for 3 sec, happens every 5 min exactly. During noise period, kernel_task use +25% CPU for 3 sec, Console->wifi.log put message staring with SCAN request received from pid ??? (locationd) with priority=2, qos=-1 (default), frontmost=no I checked Wireshark, it receives RTP/UDP packets every 20ms. But during noise period, no package for 140ms. That makes no sound period and noise. If I disable WiFi and use Ether cable, the noise is gone. If I disable Settings -> Security & Privacy -> Location Services, the noise is gone. Is there any way to receive RTP/UDP package during locationd's scan? My environment: macOS Big Sur ver 11.4 iMac (Retina 5K, 27-inch, 2017) VLC 3.0.16(Intel 64bit)
Posted
by Himadeus.
Last updated
.
Post not yet marked as solved
1 Replies
618 Views
I saw NSNetServiceBrowser is marked as deprecated on Apple document. But I cannot see replacement of this class. I need to write mDNS finder program. Should I use NSNetServiceBrowser or another class?
Posted
by Himadeus.
Last updated
.