首页 \ 问答 \ Powershell作业内存消耗问题(Powershell Job Memory Consumption Issue)

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
更新时间:2022-08-19 11:08

最满意答案

那么你也可以像这样在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 ...
  • 那么你也可以像这样在UIView上使用addGestureRecognizer方法: // In some View controller UITapGestureRecognizer *tapGR; tapGR = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)] autorelease]; tapGR.numberOfTapsRequired = 1; [myUIView addGestu ...
  • 调试信息现在出现在调试导航器 (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 ...
  • 您需要做的就是声明您要打开的网址,并将该坏男孩提供给正确的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 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)