Powershell作业内存消耗问题(Powershell Job Memory Consumption Issue)
我已经苦苦挣扎了一个星期了,并且已经用尽了我在网上找到的所有方法和选项。 我希望这里有人能够帮助我解决这个问题。
我正在使用powershell启动8个作业,每个作业运行FFmpeg将7分钟的文件传输到远程RTMP服务器。 这是从磁盘上的文件中提取的,每个作业使用不同的文件。 该命令位于do while循环中,以便不断地重新开始。
这导致我启动作业的shell积累了大量内存,消耗了所有可能的内存。 在24小时内,它消耗了32 GB的服务器中的30个。
这里是我的启动代码,任何帮助将不胜感激。
start-job -Name v6 -scriptblock { do { $d = $true; $f = Invoke-Expression -Command "ffmpeg -re -i `"C:\Shares\Matthew\180p_3000k.mp4`" -vcodec copy -acodec copy -f flv -y rtmp://<ip>/<appName>/<streamName>"; $f = $null } while ($d = $true)
}
我已经尝试接收作业并将其管道输出为null,我已经尝试在启动do while循环之前将$ f设置为$ null,以及我在网上找到的其他一些东西但无济于事。 感谢大家的时间!
I've been struggling with this for a week now and have exhausted all the methods and options I have found online. I am hoping someone here will be able to help me out with this.
I am using powershell to start 8 jobs, each job running FFmpeg to stream a 7 minute file to a remote RTMP server. This is pulling from a file on the disk and each job uses a different file. The command is in a do while loop so that it is constantly restreaming.
This is causing the shell I launched the jobs from to accumulate a massive amount of memory, consuming all that it can. In 24 hours it consumed 30 of the 32 GB of my server.
Here is my launch code, any help would be appreciated.
start-job -Name v6 -scriptblock { do { $d = $true; $f = Invoke-Expression -Command "ffmpeg -re -i `"C:\Shares\Matthew\180p_3000k.mp4`" -vcodec copy -acodec copy -f flv -y rtmp://<ip>/<appName>/<streamName>"; $f = $null } while ($d = $true)
}
I've tried to receive the jobs and pipe it to out-null, I've tried setting $f to $null before starting the do while loop, and some other things I found online but to no avail. Thanks everyone for your time!
原文:https://stackoverflow.com/questions/29350901
最满意答案
那么你也可以像这样在UIView上使用addGestureRecognizer方法:
// In some View controller UITapGestureRecognizer *tapGR; tapGR = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)] autorelease]; tapGR.numberOfTapsRequired = 1; [myUIView addGestureRecognizer:tapGR]; // Add a delegate method to handle the tap and do something with it. -(void)handleTap:(UITapGestureRecognizer *)sender { if (sender.state == UIGestureRecognizerStateEnded) { // handling code } }
Well you can also use the addGestureRecognizer method on UIView like so:
// In some View controller UITapGestureRecognizer *tapGR; tapGR = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)] autorelease]; tapGR.numberOfTapsRequired = 1; [myUIView addGestureRecognizer:tapGR]; // Add a delegate method to handle the tap and do something with it. -(void)handleTap:(UITapGestureRecognizer *)sender { if (sender.state == UIGestureRecognizerStateEnded) { // handling code } }
相关问答
更多-
根据你的评论,如果你想知道图像的索引,那么你可以通过图像视图的tag属性来做到这一点。 根据需要分配图像视图的tag属性,并在Touch事件上获取tag 。 例如 : 添加UITapGestureRecognizer ITapGestureRecognizer* tap = [[UITapGestureRecognizer alloc] initWithTarget:self ac ...
-
您的操作必须在FavoriteView.swift文件中设置,而不是在ViewController文件中设置! I've solved it now by using delegates, as suggested by BenjG37 and bpolat. Thanks! My FavoritesView.xib is linked to FavoritesView.swift. This contains the code of the view and defines the protocol fo ...
-
我建议设置 _scrollView.layer.borderColor = [UIColor redColor].CGColor; _scrollView.layer.borderWidth = 1; 这将显示您的滚动视图边界的确切位置,这可能不是您认为的位置,或者可能被其他内容覆盖。 此外,当我打开键盘时,我通常将scrollview框架底部设置为键盘顶部。 否则,您可能在键盘下方有无法访问的内容。 不确定这是否与您的问题完全相关。 I am assuming there must be a bette ...
-
即使单击它,您的方法也不会触发。 但是在动画制作will fire when you click in its final frame时will fire when you click in its final frame 。 让我们说你的按钮有初始框架(0,0,100,100) , 现在你将它移动到(200,200,100,100 )的框架。 移动时,如果你点击(200,200,100,100)-final frame ,那么你将获得事件。 但是在middle of path区域(50,50,100,10 ...
-
你在标签中列出了osx和ios ,但我猜这是一个OS X问题。 IB的属性检查器中有一个“边界”复选框,用于NSColorWell。 这可以在按钮样式的颜色之间切换,这是您要求的颜色,以及只能拖动颜色样本的颜色。 确保已经检查过,你会得到你期望的动作。 You listed both osx and ios in the tags, but I'm guessing this is an OS X problem. There is a "Bordered" checkbox in IB's Attribu ...
-
点击/点击查看动作Xcode(tap/click view action Xcode)[2023-07-13]
那么你也可以像这样在UIView上使用addGestureRecognizer方法: // In some View controller UITapGestureRecognizer *tapGR; tapGR = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)] autorelease]; tapGR.numberOfTapsRequired = 1; [myUIView addGestu ... -
Xcode 4调试(Xcode 4 debugging)[2022-05-28]
调试信息现在出现在调试导航器 (Cmd-5)和调试区域 (Shift-Cmd-Y)中。 当您运行应用程序(或点击断点)时,您可以通过切换Xcode首选项的“行为”选项卡中的选项来默认显示这些区域。 Debugging information now appears in the debug navigator (Cmd-5) and the debug area (Shift-Cmd-Y). You can have these areas show up by default when you run t ... -
您只能将操作连接到UIControl子类。 您正在尝试从UIView创建一个操作,该操作不是UIControl的子类,也没有操作。 从按钮开始拖动,而不是“主视图” You can connect actions only to subclasses of UIControl. You are trying to create an action from a UIView, which is not a subclass of UIControl and does not have actions. St ...
-
UIAlert Action xcode 8(UIAlert Action xcode 8)[2022-11-29]
您需要做的就是声明您要打开的网址,并将该坏男孩提供给正确的API。 func createAlert (title: String, message:String) { let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: output.text, style ... -
更新:看起来有一个Xcode 8错误。 我尝试使用8.1设置背景场景时遇到了同样的错误。 我将向Apple提交雷达票 它曾经工作...... 使用场景下方的下拉菜单(以及时间轴上方。)我通常使用GameScene.sks作为背景来查看我在游戏世界中的行为。 见screengrab Update: Looks like there is an Xcode 8 bug. I get the same error you did trying to set the background scene using 8 ...